home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / usenet / volume2 / nethack / patch1 < prev   
Encoding:
Internet Message Format  |  1987-08-16  |  60.2 KB

  1. Path: uunet!husc6!mit-eddie!uw-beaver!tektronix!tekgen!tekred!games-request
  2. From: games-request@tekred.TEK.COM
  3. Newsgroups: comp.sources.games
  4. Subject: v02i032:  nethack - display oriented dungeons & dragons, Patch1
  5. Summary: nethack official patch
  6. Message-ID: <1511@tekred.TEK.COM>
  7. Date: 14 Aug 87 22:15:24 GMT
  8. Sender: billr@tekred.TEK.COM
  9. Lines: 3268
  10. Approved: billr@tekred.TEK.COM
  11.  
  12. Submitted by: mike@genat.UUCP (Mike Stephenson)
  13. Comp.sources.games: Volume 2, Issue 32
  14. Archive-name: nethack/Patch1
  15.  
  16.     [This is the first official patch for the previously posted
  17.      nethack game.  Send additional bugs/fixes to Mike.   -br]
  18.  
  19. #! /bin/sh
  20. # This is a shell archive.  Remove anything before this line, then unpack
  21. # it by saving it into a file and typing "sh file".  To overwrite existing
  22. # files, type "sh file -c".  You can also feed this as standard input via
  23. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  24. # will see the following message at the end:
  25. #        "End of shell archive."
  26. # Contents:  README.NEW Fixes.1.4 Manifest.upd Makefile.tcc Maketcc.ini
  27. #   update.patches
  28. # Wrapped by billr@tekred on Fri Aug 14 15:09:29 1987
  29. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  30. if test -f README.NEW -a "${1}" != "-c" ; then 
  31.   echo shar: Will not over-write existing file \"README.NEW\"
  32. else
  33. echo shar: Extracting \"README.NEW\" \(2441 characters\)
  34. sed "s/^X//" >README.NEW <<'END_OF_README.NEW'
  35. X            NetHack Release 1.4 README
  36. X
  37. X    Hi there folks.  Here is the new release of NetHack.  What I have
  38. Xdone over the past few weeks is to collect and implement all of the bug fixes
  39. Xand modifications (there were even a few additions!) to the code.
  40. X
  41. X    To implement this update, unpack the files in the same directory as
  42. Xyour original ***UNADULTERATED*** 1.3d sources.  It is imperitive that you
  43. Xhaven't patched any of the source since the update is done in a very simple
  44. Xway by ed (approximately 150Kb size is saved doing it this way).  Since ed is
  45. Xbeing used to apply the patches, they will be applied by absolute line number,
  46. Xnot by context.  As a result, any additional or missing lines in your code
  47. Xcould (almost certainly will) cause the patches to be applied in the wrong
  48. Xplaces.
  49. X
  50. X    You can (with some difficulty) apply the patches by hand.  It is
  51. Xeasier to do this with a multi-window editor like Emacs.
  52. X
  53. X    There are a couple of additional "Make" files included to extend
  54. Xthe portability to include the Turbo "C" compiler.  These files have "tcc"
  55. Xin the name.
  56. X
  57. X    The file Manifest gives a list of the files which will be modified
  58. Xduring the update process.
  59. X
  60. X    The Fixes.1.4 file gives a more or less complete list of bug fixes.
  61. X
  62. X    The update is provided in a form which can be run as a shell script.
  63. XEither "sh" or "csh" can be used.  Simply type "[c]sh update.patches".  You
  64. Xwill require "cp" and "ed".  Each of the (68) files it modifies will be
  65. Xprocessed as follows:
  66. X
  67. X    cp $file $file.orig
  68. X    ed $file
  69. X
  70. X    ... modifications made ...
  71. X
  72. X    w
  73. X    q
  74. X
  75. X    There *are* a few bugs still in the code.  Here's a list of the ones
  76. XI know about:
  77. X
  78. X    1)    There is still something wrong with mkmon().  It won't make
  79. X        "B"'s and it seems to be responsible for some of those deep
  80. X    in the dungeon crashes.
  81. X
  82. X    2)    The leash code (as I explained in the README for the initial
  83. X        release) is very crude.  It won't handle the case of you
  84. X    dropping the leash while it is still attached to the dog.  If you do,
  85. X    the game still considers you and the dog to be "attached".
  86. X
  87. X    3)    I have modified the files to build on Xenix and Dos, but have
  88. X        not tested them.  There may be a few minor glitches left.
  89. X
  90. X    I will be going to England for three weeks starting on the 19th of
  91. XAugust.  As a result, the mail is going to stack up here.  I will take all
  92. Xof the patches and fixes when I get back and put together an update for a
  93. X1.5 (or maybe 2.0) release.
  94. X
  95. X            Happy Hacking!!!
  96. X                        Mike Stephenson
  97. END_OF_README.NEW
  98. if test 2441 -ne `wc -c <README.NEW`; then
  99.     echo shar: \"README.NEW\" unpacked with wrong size!
  100. fi
  101. # end of overwriting check
  102. fi
  103. if test -f Fixes.1.4 -a "${1}" != "-c" ; then 
  104.   echo shar: Will not over-write existing file \"Fixes.1.4\"
  105. else
  106. echo shar: Extracting \"Fixes.1.4\" \(2796 characters\)
  107. sed "s/^X//" >Fixes.1.4 <<'END_OF_Fixes.1.4'
  108. X        NetHack Fixes List    Revision 1.4
  109. X
  110. Xdogmove.c:    Death code fixed so dog with <1 hp doesn't "die of hunger".
  111. X        Slack leash message not invoked unless leash attached.
  112. X        Added "DOGNAME" option (thanks to Roland McGrath).
  113. X
  114. Xu_init.c:    Priest(esse)s start off with their weapon blessed.
  115. X
  116. Xspell.c:    Allows high level characters to cast spells upon themselves
  117. Xzap.c:        (such as polymorph).
  118. X
  119. Xpray.c:        allows for de-cursing worn rings as well as weapons.
  120. X        Knights, Priests and Priestesses can now "#turn" undead
  121. X        (UNDEAD = "VWZ &").
  122. X        fixed bugs in blessings bestowed by gods.
  123. X
  124. Xread.c:        SPE_CAUSE_FEAR does not give a "You hear..." message unless no
  125. X        monsters are nearby.
  126. X        fix to bug in "do_genocide" which allowed player to wipe out
  127. X        all '@'s and survive.
  128. X
  129. Xpolyself.c:    fix to rehumanize to catch players who wipe out '@'s while
  130. X        in polymorphed form as they de-polymorph.
  131. X
  132. Xwield.c:    bug causing segmentation fault on "w-" followed by "w[weapon]"
  133. X        fixed by chuq@sun
  134. X
  135. Xtrap.c:        similar null pointer problem corrected.
  136. X
  137. Xmake.exe.uu:    correction of names at top of uuencoded files which caused the
  138. Xnansi.sys.uu:    original files to be overwritten by the decoded files when
  139. X        uudecode was invoked. (found by len@elxsi).
  140. X
  141. Xnethack.6:    general beautification and appropriate acknowledgement of
  142. X        trademarks to avoid getting sued. :-) (thanks chuq)
  143. X
  144. Xhelp:        addition of "V" and "#" commands to help text.
  145. X
  146. Xinvent.c:    fix to REDO bug inhibiting the appearance of the item usage
  147. X        prompt.
  148. X
  149. Xmakedefs.c:    added "{", "\" and corrected Rockmole definition in "data".
  150. X        fixed things for Dos users (file open modes, etc.)
  151. X
  152. Xcmd.c:        added #[command] auto-substitution.
  153. X
  154. Xtermcap.c:    fixed termlib / curses dependencies.
  155. X        fixed null padding bug on output of SO/SE/HI/HE.
  156. X
  157. Xpcmain.c:    many fixes by Ralf Brown (ralf@b.gp.cs.cmu.edu) to allow the
  158. Xpcunix.c:    program to be compiled using the Turbo C compiler in a Dos
  159. XMakefile.tcc:    enviornment.
  160. X
  161. Xengrave.c:    engravings burned or engraved into the floor (as opposed to
  162. X        those made with finger or marker) can be felt out when blind.
  163. X        (inspired by Stefan Wrammerfors).
  164. X
  165. Xmon.c:        fixed "monster looked at a strange trap" bug for 16 bit
  166. X        machines (long vs. int problem reported by mike@cimcor). 
  167. X
  168. Xfight.c:    hitmm() fixed to return 0 (no hit) if either monster passed
  169. X        in is non-existant.  This fixes a number of null reference
  170. X        problems (ex. monmove.c[~360]).
  171. X        Misc zero reference errors fixed by Paul Eggert. eggert@grand
  172. X
  173. XMakefile.xenix:    New version (that works) supplied by Greg Laskin greg@smash
  174. X
  175. Xfountain.c:    Misc zero reference errors fixed by Paul Eggert. eggert@grand
  176. Xsearch.c:
  177. X
  178. Xoptions.c:    New options added for GRAPHICS, DOGNAME, and new routine
  179. X        added to allow easier sorting of string parameters (":,"
  180. X        are considered to be string terminators for copying in
  181. X        name, and dogname).
  182. END_OF_Fixes.1.4
  183. if test 2796 -ne `wc -c <Fixes.1.4`; then
  184.     echo shar: \"Fixes.1.4\" unpacked with wrong size!
  185. fi
  186. # end of overwriting check
  187. fi
  188. if test -f Manifest.upd -a "${1}" != "-c" ; then 
  189.   echo shar: Will not over-write existing file \"Manifest.upd\"
  190. else
  191. echo shar: Extracting \"Manifest.upd\" \(562 characters\)
  192. sed "s/^X//" >Manifest.upd <<'END_OF_Manifest.upd'
  193. XMakefile.pc
  194. XMakefile.unix
  195. XMakefile.xenix
  196. Xapply.c
  197. Xcmd.c
  198. Xconfig.h
  199. Xdata.base
  200. Xdecl.c
  201. Xdo.c
  202. Xdo_name.c
  203. Xdog.c
  204. Xdogmove.c
  205. Xeat.c
  206. Xend.c
  207. Xengrave.c
  208. Xfight.c
  209. Xfountain.c
  210. Xhack.c
  211. Xhack.h
  212. Xhelp
  213. Xhh
  214. Xinvent.c
  215. Xlev.c
  216. Xmakedefs.c
  217. Xmakemon.c
  218. Xmklev.c
  219. Xmkmaze.c
  220. Xmkobj.c
  221. Xmon.c
  222. Xmsdos.c
  223. Xmsdos.h
  224. Xnethack.6
  225. Xo_init.c
  226. Xobjclass.h
  227. Xobjects.h
  228. Xoptions.c
  229. Xpager.c
  230. Xpcmain.c
  231. Xpctty.c
  232. Xpcunix.c
  233. Xpolyself.c
  234. Xpotion.c
  235. Xpray.c
  236. Xpri.c
  237. Xprisym.c
  238. Xread.c
  239. Xrip.c
  240. Xrm.h
  241. Xrnd.c
  242. Xsave.c
  243. Xsearch.c
  244. Xshk.c
  245. Xsit.c
  246. Xspell.c
  247. Xsteal.c
  248. Xtermcap.c
  249. Xtopl.c
  250. Xtopten.c
  251. Xtrap.c
  252. Xu_init.c
  253. Xunixmain.c
  254. Xunixtty.c
  255. Xversion.c
  256. Xwield.c
  257. Xwizard.c
  258. Xwrite.c
  259. Xyou.h
  260. Xzap.c
  261. END_OF_Manifest.upd
  262. if test 562 -ne `wc -c <Manifest.upd`; then
  263.     echo shar: \"Manifest.upd\" unpacked with wrong size!
  264. fi
  265. # end of overwriting check
  266. fi
  267. if test -f Makefile.tcc -a "${1}" != "-c" ; then 
  268.   echo shar: Will not over-write existing file \"Makefile.tcc\"
  269. else
  270. echo shar: Extracting \"Makefile.tcc\" \(4358 characters\)
  271. sed "s/^X//" >Makefile.tcc <<'END_OF_Makefile.tcc'
  272. X#
  273. X#    SCCS Id: @(#)Makefile.tcc    1.4    87/08/08
  274. X#     Makefile for NetHack (PC) version 1.0 written using
  275. X#    Turbo C v1.0
  276. X# 
  277. X# Unfortunately, large model is limited to a total of 64K global data
  278. X# Huge memory model, remove stack probes, optimize for space:
  279. XWIZARD=
  280. XV = 14
  281. XCFLAGS = -m$(MODEL) -DLINT_ARGS -DVER=$(V) $(WIZARD) -N- -Z -K- -O -w-pro -w-nod
  282. X
  283. X# The game name
  284. XGAME = hack.exe
  285. X
  286. X# The game directory
  287. XGAMEDIR = .
  288. X
  289. X# The directory containing the libraries
  290. XLIBDIR = c:\c\lib
  291. X
  292. X# All object modules
  293. XOBJS = decl.obj apply.obj bones.obj cmd.obj do.obj dothrow.obj\
  294. X    do_name.obj do_wear.obj dog.obj dogmove.obj eat.obj end.obj \
  295. X    engrave.obj fight.obj fountain.obj hack.obj invent.obj \
  296. X    lev.obj main.obj makemon.obj mhitu.obj mklev.obj \
  297. X    mkmaze.obj mkobj.obj mkshop.obj mon.obj monmove.obj\
  298. X    monst.obj o_init.obj objnam.obj options.obj \
  299. X    pager.obj polyself.obj potion.obj pray.obj pri.obj prisym.obj\
  300. X    read.obj rip.obj rumors.obj save.obj \
  301. X    search.obj shk.obj shknam.obj sit.obj spell.obj steal.obj \
  302. X    termcap.obj timeout.obj topl.obj topten.obj track.obj trap.obj \
  303. X    tty.obj unix.obj u_init.obj vault.obj wield.obj \
  304. X    wizard.obj worm.obj worn.obj write.obj zap.obj \
  305. X    version.obj rnd.obj alloc.obj msdos.obj
  306. X
  307. X# The main target
  308. X#
  309. X$(GAME) : $(OBJS)
  310. X    link /x:400 $(LIBDIR)\c0$(MODEL).obj @objs.lnk,$(GAME),,$(LIBDIR)\c$(MODEL).lib
  311. X
  312. X#    variable auxilary files.
  313. X#
  314. XVARAUX = data rumors
  315. X
  316. Xinstall : $(GAME) $(VARAUX)
  317. X    - exepack $(GAME) $(GAMEDIR)\$(GAME)
  318. X    - exemod $(GAMEDIR)\$(GAME) /max 1
  319. X
  320. Xclean :
  321. X    erase $(GAME)
  322. X
  323. Xspotless: clean
  324. X    erase *.obj
  325. X    erase main.c
  326. X    erase tty.c
  327. X    erase unix.c
  328. X
  329. Xsrcs :
  330. X    copy makefile \tmp
  331. X    copy *.c \tmp
  332. X    copy *.h \tmp
  333. X    copy \local\make\make.doc \tmp
  334. X    copy \local\make\make.ini \tmp
  335. X    copy \bin\make.exe \tmp
  336. X    cd \tmp
  337. X    time
  338. X    touch *.*
  339. X    arc m hack$Vs * *.*
  340. X    cd $(CWD)
  341. X
  342. X
  343. X#    Other dependencies
  344. X#
  345. XRUMORFILES= rumors.bas rumors.kaa rumors.mrx
  346. X
  347. Xmakedefs.exe:    makedefs.c alloc.obj config.h
  348. X    cl -AL makedefs.c alloc.obj
  349. X
  350. X
  351. Xrumors :  config.h $(RUMORFILES) makedefs.exe
  352. X    makedefs.exe -r
  353. X
  354. Xdata :  config.h data.bas makedefs.exe
  355. X    makedefs.exe -d
  356. X
  357. Xonames.h :  config.h objects.h makedefs.exe
  358. X    makedefs.exe -o
  359. X
  360. X#    Below is a kluge.  date.h should actually depend on any source
  361. X#    module being changed. (but hack.h is close enough for most).
  362. X#
  363. Xdate.h :  hack.h makedefs.exe
  364. X    makedefs.exe -D
  365. X
  366. Xtrap.h :  config.h makedefs.exe
  367. X    makedefs.exe -t
  368. X
  369. Xmain.obj : main.c
  370. X
  371. Xmain.c :  pcmain.c hack.h
  372. X    copy pcmain.c main.c
  373. X    touch main.c
  374. X
  375. Xtty.obj : tty.c
  376. X
  377. Xtty.c :  pctty.c hack.h msdos.h
  378. X    copy pctty.c tty.c
  379. X    touch tty.c
  380. X
  381. Xunix.obj : unix.c
  382. X
  383. Xunix.c :  pcunix.c hack.h mkroom.h
  384. X    copy pcunix.c unix.c
  385. X    touch unix.c
  386. X
  387. Xdecl.obj :  hack.h mkroom.h
  388. Xapply.obj :  hack.h edog.h mkroom.h
  389. Xbones.obj :  hack.h
  390. Xhack.obj :  hack.h
  391. Xcmd.obj :  hack.h func_tab.h msdos.h
  392. Xdo.obj :  hack.h
  393. Xdo_name.obj :  hack.h
  394. Xdo_wear.obj :  hack.h
  395. Xdog.obj :  hack.h edog.h mkroom.h
  396. Xdogmove.obj :  hack.h mfndpos.h
  397. Xdothrow.obj :  hack.h
  398. Xeat.obj :  hack.h
  399. Xend.obj :  hack.h
  400. Xengrave.obj :  hack.h
  401. Xfight.obj :  hack.h
  402. Xfountain.obj :  hack.h
  403. Xinvent.obj :  hack.h wseg.h
  404. Xioctl.obj :  config.h
  405. Xlev.obj :  hack.h mkroom.h wseg.h
  406. Xmakemon.obj :  hack.h
  407. Xmhitu.obj :  hack.h
  408. Xmklev.obj :  hack.h mkroom.h
  409. Xmkmaze.obj :  hack.h mkroom.h
  410. Xmkobj.obj :  hack.h
  411. Xmkshop.obj :  hack.h mkroom.h eshk.h
  412. Xmon.obj :  hack.h mfndpos.h
  413. Xmonmove.obj :  hack.h mfndpos.h
  414. Xmonst.obj :  hack.h eshk.h
  415. Xo_init.obj :  config.h objects.h onames.h
  416. Xobjnam.obj :  hack.h
  417. Xoptions.obj :  config.h hack.h
  418. Xpager.obj :  hack.h
  419. Xpolyself.obj :  hack.h
  420. Xpotion.obj :  hack.h
  421. Xpray.obj :  hack.h
  422. Xpri.obj :  hack.h
  423. Xprisym.obj :  hack.h wseg.h
  424. Xread.obj :  hack.h
  425. Xrip.obj :  hack.h
  426. X    tcc -c $(CFLAGS) -d- rip.c
  427. Xrumors.obj :  config.h
  428. Xsave.obj :  hack.h
  429. Xsearch.obj :  hack.h
  430. Xshk.obj :  hack.h mfndpos.h mkroom.h eshk.h
  431. Xshknam.obj :  hack.h
  432. Xsit.obj :  hack.h
  433. Xspell.obj:  hack.h
  434. Xsteal.obj :  hack.h
  435. Xtermcap.obj :  config.h flag.h
  436. Xtimeout.obj :  hack.h
  437. Xtopl.obj :  hack.h
  438. Xtopten.obj :  hack.h
  439. Xtrack.obj :  hack.h
  440. Xtrap.obj :  hack.h mkroom.h
  441. Xu_init.obj :  hack.h
  442. Xvault.obj :  hack.h mkroom.h
  443. Xversion.obj : hack.h date.h
  444. Xwield.obj :  hack.h
  445. Xwizard.obj :  hack.h
  446. Xworm.obj :  hack.h wseg.h
  447. Xworn.obj :  hack.h
  448. Xwrite.obj :  hack.h
  449. Xzap.obj :  hack.h
  450. Xmsdos.obj : msdos.h
  451. Xextern.h: config.h
  452. X    touch extern.h
  453. Xhack.h :  config.h objclass.h monst.h gold.h trap.h obj.h flag.h rm.h permonst.h onames.h spell.h extern.h you.h
  454. X    touch hack.h
  455. Xobjects.h :  config.h objclass.h
  456. X    touch objects.h
  457. END_OF_Makefile.tcc
  458. if test 4358 -ne `wc -c <Makefile.tcc`; then
  459.     echo shar: \"Makefile.tcc\" unpacked with wrong size!
  460. fi
  461. # end of overwriting check
  462. fi
  463. if test -f Maketcc.ini -a "${1}" != "-c" ; then 
  464.   echo shar: Will not over-write existing file \"Maketcc.ini\"
  465. else
  466. echo shar: Extracting \"Maketcc.ini\" \(1759 characters\)
  467. sed "s/^X//" >Maketcc.ini <<'END_OF_Maketcc.ini'
  468. X#    SCCS Id: @(#)Maketcc.ini    1.4    87/08/08
  469. X# This is a sample `make.ini' file for NDMAKE v3.7.  You will probably want
  470. X# to customize it for your system.
  471. X
  472. X
  473. X
  474. X# The order to search for rules and files is specified by .SUFFIXES
  475. X#.SUFFIXES : .exe .obj .c .for .asm
  476. X
  477. X# A few macros.
  478. XCFLAGS = -m$(MODEL)
  479. XMODEL = h
  480. XLIBS = c:\c\lib\emu.lib c:\c\lib\math$(MODEL).lib c:\c\lib\c$(MODEL).lib
  481. XBIN =
  482. XLFLAGS =
  483. X
  484. X# A universally useful target.
  485. X#clean:
  486. X#    +-erase *.bak
  487. X#    +-erase *.map
  488. X
  489. X# .BEFORE and .AFTER can be used to turn DPATH off and on.
  490. X#.BEFORE:; @+echo For help with ndmake, use the command `make -h'
  491. X#.AFTER:; @+echo All done.
  492. X
  493. X
  494. X# DEFAULT RULES
  495. X# To produce a `.obj' file from a `.asm' file using MASM.
  496. X.asm.obj:
  497. X    masm $*.asm;
  498. X
  499. X# To produce a `.obj' file from a `.c' file using Microsoft C. 
  500. X.c.obj:
  501. X    tcc -c $(CFLAGS) $*.c
  502. X
  503. X# To produce a `.obj' file from a `.for' file using Microsoft Fortran.
  504. X.for.obj:
  505. X    for1 $*.for;
  506. X    pas2
  507. X
  508. X# To produce a `.exe' file from an `.obj' file.  Note that there is a
  509. X# problem because LIBS may be different for linking `.obj' files
  510. X# produced by different compilers (C, FORTRAN, PASCAL, etc).  To avoid
  511. X# this problem you may want to have the C compiler produce `.cbj' files,
  512. X# the FORTRAN compiler produce `.fbj' files, etc.  Then you could write
  513. X# specific rules for `.cbj.exe' and `.fbj.exe' which would use the correct
  514. X# libraries.
  515. X.obj.exe:
  516. X    tlink c:\c\lib\c0$(MODEL).obj $*.obj,$@,,$(LIBS) $(LFLAGS);
  517. X
  518. X# To produce a `.exe' file from a `.asm' file.
  519. X.asm.exe:
  520. X    masm $*.asm;
  521. X    tlink $*.obj, $@,, $(LIBS)
  522. X    erase $*.obj
  523. X
  524. X# To produce a `.exe' file from a `.c' file.
  525. X.c.exe:
  526. X    tcc $(CFLAGS) $*.c
  527. X    erase $*.obj
  528. X
  529. X# To produce a `.exe' file from a `.for' file.
  530. X.for.exe:
  531. X    for1 $*.for;
  532. X    pas2
  533. X    link $*.obj, $@,, $(LIB)\FORTRAN.LIB
  534. X    erase $*.obj
  535. END_OF_Maketcc.ini
  536. if test 1759 -ne `wc -c <Maketcc.ini`; then
  537.     echo shar: \"Maketcc.ini\" unpacked with wrong size!
  538. fi
  539. # end of overwriting check
  540. fi
  541. if test -f update.patches -a "${1}" != "-c" ; then 
  542.   echo shar: Will not over-write existing file \"update.patches\"
  543. else
  544. echo shar: Extracting \"update.patches\" \(43078 characters\)
  545. sed "s/^X//" >update.patches <<'END_OF_update.patches'
  546. Xcp Makefile.pc Makefile.pc.orig
  547. Xed Makefile.pc <<ED_EOF
  548. X114a
  549. Xdothrow.obj :  hack.h
  550. X.
  551. X103a
  552. X    touch unix.c
  553. X.
  554. X100c
  555. Xunix.obj : unix.c
  556. X.
  557. X98a
  558. X    touch tty.c
  559. X.
  560. X95c
  561. Xtty.obj : tty.c
  562. X.
  563. X93a
  564. X    touch main.c
  565. X.
  566. X90c
  567. Xmain.obj : main.c
  568. X.
  569. X87,88c
  570. Xtrap.h :  config.h makedefs.exe
  571. X    makedefs.exe -t
  572. X.
  573. X84,85c
  574. Xdate.h :  hack.h makedefs.exe
  575. X    makedefs.exe -D
  576. X.
  577. X80a
  578. Xdata :  config.h data.bas makedefs.exe
  579. X    makedefs.exe -d
  580. X
  581. Xonames.h :  config.h objects.h makedefs.exe
  582. X    makedefs.exe -o
  583. X
  584. X.
  585. X78,79c
  586. Xrumors :  config.h $(RUMORFILES) makedefs.exe
  587. X    makedefs.exe -r
  588. X.
  589. X75,76d
  590. X72,73c
  591. Xmakedefs.exe:    makedefs.c alloc.obj config.h
  592. X    cl -AL makedefs.c alloc.obj
  593. X.
  594. X70c
  595. XRUMORFILES= rumors.bas rumors.kaa rumors.mrx
  596. X.
  597. X18c
  598. XOBJS = decl.obj apply.obj bones.obj cmd.obj do.obj dothrow.obj\
  599. X.
  600. X10a
  601. XLIBS =
  602. XLFLAGS =
  603. XMODEL = L
  604. XSETARGV = $(LIB)\$(MODEL)SETARGV
  605. X.SUFFIXES: .exe .obj .c
  606. X.c.obj:; cl $(CFLAGS) -c $*.c
  607. X.c.exe:;
  608. X    cl $(CFLAGS) -c $*.c
  609. X    link $*.obj $(SETARGV), $@,, $(LIBS) $(LFLAGS);
  610. X
  611. X.
  612. X9c
  613. XCFLAGS = -A$(MODEL) -DREGBUG -DLINT_ARGS -DVER=$V $(WIZARD) -Ot -Gs -Gt100
  614. X.
  615. X2c
  616. X#    SCCS Id: @(#)Makefile.pc    1.4    87/08/08
  617. X.
  618. Xw
  619. Xq
  620. XED_EOF
  621. X
  622. Xcp Makefile.unix Makefile.unix.orig
  623. Xed Makefile.unix <<ED_EOF
  624. X146a
  625. X
  626. Xtags: $(SOURCES)
  627. X    @echo ctags -tw ...
  628. X    @ctags -tw $(SOURCES)
  629. X  
  630. X.
  631. X137a
  632. X    touch $(GAMEDIR)/perm $(GAMEDIR)/record
  633. X.
  634. X134c
  635. Xinstall: $(VARAUX) $(GAME)
  636. X    -mkdir $(GAMEDIR)
  637. X    -mkdir $(GAMEDIR)/save
  638. X.
  639. X83c
  640. X    ./makedefs -o
  641. X.
  642. X80c
  643. X    ./makedefs -t
  644. X.
  645. X77c
  646. X    ./makedefs -D
  647. X.
  648. X74c
  649. X    ./makedefs -d
  650. X.
  651. X71c
  652. X    ./makedefs -r
  653. X.
  654. X60c
  655. X    @cc $(LFLAGS) -o $(GAME) $(HOBJ) $(TERMLIB)
  656. X.
  657. X22c
  658. XLFLAGS =
  659. X.
  660. X2c
  661. X#    SCCS Id: @(#)Makefile.unix    1.4    87/08/08
  662. X.
  663. Xw
  664. Xq
  665. XED_EOF
  666. X
  667. Xcp Makefile.xenix Makefile.xenix.orig
  668. Xed Makefile.xenix <<ED_EOF
  669. X288d
  670. X286d
  671. X284d
  672. X282d
  673. X280d
  674. X278d
  675. X276d
  676. X274d
  677. X272d
  678. X270d
  679. X268d
  680. X266d
  681. X264d
  682. X262d
  683. X260d
  684. X258d
  685. X256d
  686. X254d
  687. X252d
  688. X250d
  689. X248d
  690. X246d
  691. X244d
  692. X242d
  693. X240d
  694. X238d
  695. X236d
  696. X234d
  697. X232d
  698. X230d
  699. X228d
  700. X226d
  701. X224d
  702. X222d
  703. X220d
  704. X218d
  705. X216d
  706. X214d
  707. X212d
  708. X210d
  709. X208d
  710. X206d
  711. X204d
  712. X202d
  713. X200d
  714. X198d
  715. X196d
  716. X194d
  717. X192d
  718. X190d
  719. X188d
  720. X186d
  721. X184d
  722. X182d
  723. X180d
  724. X176,178d
  725. X174d
  726. X172d
  727. X170d
  728. X168d
  729. X166d
  730. X164d
  731. X161,162d
  732. X103,105d
  733. X98c
  734. X    cc ${CFLAGS} -c tty.c
  735. X.
  736. X92d
  737. X71a
  738. XSalloc.o:    alloc.c
  739. X    cp alloc.c Salloc.c
  740. X    cc -O -c Salloc.c
  741. Xpc: 
  742. X    cd dos; make
  743. X
  744. X.
  745. X69,70c
  746. Xmakedefs:    makedefs.c Salloc.o config.h
  747. X    cc -O -o makedefs Salloc.o makedefs.c
  748. X.
  749. X65a
  750. X    
  751. X.
  752. X63,64c
  753. X    cc $(LFLAGS) -m hack.map -o $(GAME) /lib/Lsignal.o $(CRT0) $(HOBJ) $(LIBS) -SEG#256
  754. X.
  755. X61a
  756. X.c.o:
  757. X    cc -O -c -Gt24 ${CFLAGS} $*.c
  758. X
  759. X.
  760. X24,25c
  761. XMANDIR  = 
  762. XCFLAGS = -LARGE -Ml
  763. X.
  764. X15,16c
  765. XLIBS = ${TERMLIB} 
  766. X.
  767. X12,13d
  768. X2c
  769. X#    SCCS Id: @(#)Makefile.xenix    1.4    87/08/08
  770. X.
  771. Xw
  772. Xq
  773. XED_EOF
  774. X
  775. Xcp apply.c apply.c.orig
  776. Xed apply.c <<ED_EOF
  777. X187d
  778. X183,185d
  779. X1c
  780. X/*    SCCS Id: @(#)apply.c    1.4    87/08/08
  781. X.
  782. Xw
  783. Xq
  784. XED_EOF
  785. X
  786. Xcp cmd.c cmd.c.orig
  787. Xed cmd.c <<ED_EOF
  788. X348a
  789. X#endif
  790. X.
  791. X347a
  792. X#ifdef COM_COMPL
  793. X    get_ext_cmd(buf);
  794. X#else
  795. X.
  796. X249c
  797. X    if(!*cmd || *cmd == (char)0377 || (flags.no_rest_on_space && *cmd == ' ')){
  798. X.
  799. X247c
  800. X    if(!*cmd || *cmd == (char)0377) {
  801. X.
  802. X214a
  803. X    "turn", "turn undead", doturn,
  804. X.
  805. X196c
  806. X    {GOLD_SYM, doprgold},
  807. X.
  808. X123c
  809. X#endif /* REDO */
  810. X.
  811. X84c
  812. Xextern int in_doagain;
  813. X.
  814. X40c
  815. X#ifdef DGKMOD
  816. X.
  817. X16c
  818. Xint dosit(), doturn();
  819. X.
  820. X1c
  821. X/*    SCCS Id: @(#)cmd.c    1.4    87/08/08
  822. X.
  823. Xw
  824. Xq
  825. XED_EOF
  826. X
  827. Xcp config.h config.h.orig
  828. Xed config.h <<ED_EOF
  829. X206a
  830. X#define COM_COMPL    /* Command line completion by John S. Bien */
  831. X#define GRAPHICS    /* Funky screen character support (Eric S. Raymond) */
  832. X#define HACKOPTIONS    /* Support DGK-style HACKOPTIONS processing (ESR) */
  833. X.
  834. X187c
  835. X
  836. X#define    DOGNAME        /* Name of your first dog as an option */ 
  837. X.
  838. X170,177d
  839. X147a
  840. X * otherwise:
  841. X *    #define    Bitfield(x,n)    unsigned x:n
  842. X.
  843. X108a
  844. X#define memcpy(d, s, n)        bcopy(s, d, n)
  845. X#define memcmp(s1, s2, n)    bcmp(s2, s1, n)
  846. X.
  847. X35,37c
  848. X/* #define TERMINFO        /* uses "curses" rather than termcap */
  849. X
  850. X#ifdef __TURBOC__
  851. X#define    alloc    malloc
  852. X#define    signal    ssignal
  853. X.
  854. X29c
  855. X#define VERSION    "1.4f"    /* version number. */
  856. X.
  857. X24a
  858. X/* #define    GENIX        /* Yet Another Unix Clone */
  859. X.
  860. X14d
  861. X1c
  862. X/*    SCCS Id: @(#)config.h    1.4    87/08/08
  863. X.
  864. Xw
  865. Xq
  866. XED_EOF
  867. X
  868. Xcp data.base data.base.orig
  869. Xed data.base <<ED_EOF
  870. X25c
  871. X`    an enormous rock
  872. X.
  873. X1,2c
  874. X    NetHack & Quest data file - version 1.1
  875. X@    human (or you in human guise)
  876. X.
  877. Xw
  878. Xq
  879. XED_EOF
  880. X
  881. Xcp decl.c decl.c.orig
  882. Xed decl.c <<ED_EOF
  883. X14d
  884. X7a
  885. X
  886. X#ifdef GRAPHICS
  887. Xstruct symbols defsyms = {
  888. X    ' ', '|', '-', '-', '-', '-', '-', '+', '.', '#', '<', '>', '^',
  889. X#ifdef FOUNTAINS
  890. X    '}', '{',
  891. X#endif
  892. X#ifdef NEWCLASS
  893. X    '\\',
  894. X#endif
  895. X#ifdef SPIDERS
  896. X    '"',
  897. X#endif
  898. X};
  899. X#endif
  900. Xstruct symbols showsyms;    /* will contain the symbols actually used */
  901. X
  902. X.
  903. X1c
  904. X/*    SCCS Id: @(#)decl.c    1.4    87/08/08
  905. X.
  906. Xw
  907. Xq
  908. XED_EOF
  909. X
  910. Xcp do.c do.c.orig
  911. Xed do.c <<ED_EOF
  912. X301c
  913. X    read_engr_at(u.ux,u.uy);
  914. X.
  915. X27c
  916. X    if(obj->olet == GOLD_SYM) {        /* pseudo object */
  917. X.
  918. X1c
  919. X/*    SCCS Id: @(#)do.c    1.4    87/08/08
  920. X.
  921. Xw
  922. Xq
  923. XED_EOF
  924. X
  925. Xcp do_name.c do_name.c.orig
  926. Xed do_name.c <<ED_EOF
  927. X215,221c
  928. X    "Ron", "Tom", "Wilmar", "Nick Danger", "Phoenix", "Miracleman",
  929. X    "Stephan"
  930. X.
  931. X209d
  932. X55c
  933. X    getpos(&cc, 0, "the monster you want to name");
  934. X.
  935. X44,46c
  936. X    cc->x = cx;
  937. X    cc->y = cy;
  938. X    return(0);
  939. X.
  940. X37,39c
  941. X            cc->x = -1;
  942. X            cc->y = 0;
  943. X            return(0);
  944. X.
  945. X16d
  946. X10,11c
  947. Xgetpos(cc,force,goal)
  948. Xcoord    *cc;
  949. Xint force; char *goal;
  950. X{
  951. X.
  952. X1c
  953. X/*    SCCS Id: @(#)do_name.c    1.4    87/08/08
  954. X.
  955. Xw
  956. Xq
  957. XED_EOF
  958. X
  959. Xcp dog.c dog.c.orig
  960. Xed dog.c <<ED_EOF
  961. X20a
  962. X#ifdef    DOGNAME
  963. X    if (dogname[0]) {
  964. X        register struct monst *mtmp2;
  965. X        mtmp->mnamelth = strlen(dogname);
  966. X        mtmp2 = newmonst(sizeof(struct edog) + mtmp->mnamelth);
  967. X        *mtmp2 = *mtmp;
  968. X        strcpy(NAME(mtmp2), dogname);
  969. X        replmon(mtmp, mtmp2);
  970. X        mtmp = mtmp2;
  971. X    }
  972. X#endif    /* DOGNAME */
  973. X.
  974. X9a
  975. X#ifdef    DOGNAME
  976. Xchar dogname[63];
  977. X#endif    /* DOGNAME */
  978. X
  979. X.
  980. X1c
  981. X/*    SCCS Id: @(#)dog.c    1.4    87/08/08
  982. X.
  983. Xw
  984. Xq
  985. XED_EOF
  986. X
  987. Xcp dogmove.c dogmove.c.orig
  988. Xed dogmove.c <<ED_EOF
  989. X198,199c
  990. X            if(mtmp2)
  991. X                if(mtmp2->data->mlevel >= mdat->mlevel+2 ||
  992. X                   mtmp2->data->mlet == 'c')
  993. X.
  994. X51c
  995. X        if(cansee(omx,omy))
  996. X            pline("%s dies%s.", Monnam(mtmp),
  997. X                  (mtmp->mhp >= 1) ? "" : " from hunger");
  998. X        else
  999. X            pline("You have a sad feeling for a moment, then it passes.");
  1000. X.
  1001. X48,49c
  1002. X        if(mtmp->mleashed) {
  1003. X            mtmp->mleashed = 0;
  1004. X            pline("Your leash goes slack...");
  1005. X        }
  1006. X.
  1007. X44,46d
  1008. X1c
  1009. X/*    SCCS Id: @(#)dogmove.c    1.4    87/08/08
  1010. X.
  1011. Xw
  1012. Xq
  1013. XED_EOF
  1014. X
  1015. Xcp eat.c eat.c.orig
  1016. Xed eat.c <<ED_EOF
  1017. X560c
  1018. X            u.usym = GOLD_SYM;
  1019. X.
  1020. X1c
  1021. X/*    SCCS Id: @(#)eat.c    1.4    87/08/08
  1022. X.
  1023. Xw
  1024. Xq
  1025. XED_EOF
  1026. X
  1027. Xcp end.c end.c.orig
  1028. Xed end.c <<ED_EOF
  1029. X67a
  1030. X        killer = buf;
  1031. X      } else if(mtmp->isshk) {         /* stewr 870807 */
  1032. X            Sprintf(buf, "shopkeeper, %s %s",
  1033. X            rn2(2) ? "Mr." : "Ms.", shkname(mtmp));
  1034. X.
  1035. X57a
  1036. Xextern char *shkname();
  1037. X.
  1038. X1c
  1039. X/*    SCCS Id: @(#)end.c    1.4    87/08/08
  1040. X.
  1041. Xw
  1042. Xq
  1043. XED_EOF
  1044. X
  1045. Xcp engrave.c engrave.c.orig
  1046. Xed engrave.c <<ED_EOF
  1047. X391c
  1048. X            /* kludge by stewr 870708 */
  1049. X    for (sptmp = sp, tmp=0; !(tmp == len); sptmp++,tmp++) {
  1050. X            if (((type == DUST) && !rn2(25))
  1051. X             || (Blind && !rn2(12))
  1052. X             || (Confusion && !rn2(3))) {
  1053. X                 *sptmp = '!' + rn2(93); /* ASCII-code only */
  1054. X               }
  1055. X          }
  1056. X
  1057. X.
  1058. X175,176c
  1059. Xregister int len, tmp;
  1060. Xregister char *sp, *sptmp;
  1061. X.
  1062. X132c
  1063. X        if (canfeel)
  1064. X        pline("You %s: \"%s\".",
  1065. X              (Blind) ? "feel the words" : "read",  ep->engr_txt);
  1066. X.
  1067. X130a
  1068. X        canfeel = 1;
  1069. X.
  1070. X125c
  1071. X        if(!Blind) pline("There's some graffiti here on the floor.");
  1072. X        canfeel = 0;
  1073. X.
  1074. X122a
  1075. X        canfeel = 1;
  1076. X.
  1077. X119a
  1078. X        canfeel = 1;
  1079. X.
  1080. X116c
  1081. X        if(!Blind) pline("Something is written here in the dust.");
  1082. X        canfeel = 0;
  1083. X.
  1084. X112a
  1085. Xregister int    canfeel;
  1086. X.
  1087. X1c
  1088. X/*    SCCS Id: @(#)engrave.c    1.4    87/08/08
  1089. X.
  1090. Xw
  1091. Xq
  1092. XED_EOF
  1093. X
  1094. Xcp fight.c fight.c.orig
  1095. Xed fight.c <<ED_EOF
  1096. X456,469d
  1097. X451,452c
  1098. X            else
  1099. X            pline("That spellbook was %s.", defmonnam(mtmp));
  1100. X        }
  1101. X        else if (levl[u.ux+u.dx][u.uy+u.dy].scrsym == GOLD_SYM)
  1102. X.
  1103. X447,448c
  1104. X        if (levl[u.ux+u.dx][u.uy+u.dy].scrsym == DOOR_SYM)
  1105. X        {
  1106. X.
  1107. X217,218c
  1108. X            if((dtmp = mkmon_at('&',u.ux,u.uy)))
  1109. X            (void)tamedog(dtmp,(struct obj *)0);
  1110. X.
  1111. X26a
  1112. X    if(!magr || !mdef) return(0);        /* mike@genat */
  1113. X.
  1114. X1c
  1115. X/*    SCCS Id: @(#)fight.c    1.4    87/08/08
  1116. X.
  1117. Xw
  1118. Xq
  1119. XED_EOF
  1120. X
  1121. Xcp fountain.c fountain.c.orig
  1122. Xed fountain.c <<ED_EOF
  1123. X61d
  1124. X58c
  1125. X    if((mtmp = mkmon_at('N',u.ux,u.uy))) {
  1126. X.
  1127. X47,52c
  1128. X    if((mtmp = mkmon_at('&',u.ux,u.uy))) {
  1129. X        pline("You have unleashed a water demon!");
  1130. X        if (rnd(100)>97) {
  1131. X        pline("Grateful for his release, he grants you a wish!");
  1132. X        makewish();
  1133. X        mondied(mtmp);
  1134. X        }
  1135. X.
  1136. X1c
  1137. X/*    SCCS Id: @(#)fountain.c    1.4    87/08/08
  1138. X.
  1139. Xw
  1140. Xq
  1141. XED_EOF
  1142. X
  1143. Xcp hack.c hack.c.orig
  1144. Xed hack.c <<ED_EOF
  1145. X1034a
  1146. X#else
  1147. X            carrcap = 5*u.ulevel;      /* New strength stewr 870807 */
  1148. X        if (u.ustr < 19) carrcap += 5*u.ustr;
  1149. X        if (u.ustr > 18) carrcap += u.ustr - 18 + 90;
  1150. X        if (u.ustr > 68) carrcap += u.ustr - 68;
  1151. X        if (u.ustr > 93) carrcap += u.ustr - 93;
  1152. X        if (u.ustr > 108) carrcap += 2*(u.ustr - 108);
  1153. X        if (u.ustr > 113) carrcap += 5*(u.ustr - 113);
  1154. X        if (u.ustr == 118) carrcap += 100;
  1155. X#endif
  1156. X.
  1157. X1033a
  1158. X#ifdef HARD
  1159. X.
  1160. X704,742d
  1161. X692c
  1162. X        } else if (sym == TRAP_SYM) {
  1163. X.
  1164. X676c
  1165. X        } else if (sym == CORR_SYM) {
  1166. X.
  1167. X672c
  1168. X        else if (sym == DOOR_SYM) {
  1169. X.
  1170. X669,670c
  1171. X        if (sym == VWALL_SYM || sym == HWALL_SYM
  1172. X            || sym == ROOM_SYM || sym == STONE_SYM
  1173. X            || IS_CORNER(sym))
  1174. X.
  1175. X665d
  1176. X515c
  1177. X    if(all || index(olets, GOLD_SYM))
  1178. X.
  1179. X465c
  1180. X        if(g_at(u.ux,u.uy)) ilets[iletct++] = GOLD_SYM;
  1181. X.
  1182. X105,106c
  1183. X            if((mtmp = m_at(rx,ry))) {
  1184. X                if(canseemon(mtmp))
  1185. X                pline("There's %s on the other side.", monnam(mtmp));
  1186. X                else
  1187. X                pline("You hear a monster behind the rock.");
  1188. X.
  1189. X96a
  1190. X    register struct    monst *mtmp, *m_at();
  1191. X.
  1192. X82,86c
  1193. X                if(!lev->lit && lev->scrsym == ROOM_SYM)
  1194. X.
  1195. X39,44c
  1196. X        if(!lev->lit && lev->scrsym == ROOM_SYM) {
  1197. X            lev->scrsym = STONE_SYM;
  1198. X.
  1199. X7c
  1200. Xstatic    char    SCCS_Id[] = "@(#)hack.c    1.4\t87/08/08";
  1201. X.
  1202. Xw
  1203. Xq
  1204. XED_EOF
  1205. X
  1206. Xcp hack.h hack.h.orig
  1207. Xed hack.h <<ED_EOF
  1208. X50a
  1209. X#else
  1210. X#define    MAX_CARR_CAP    500
  1211. X#endif
  1212. X.
  1213. X49a
  1214. X#ifdef HARD
  1215. X.
  1216. X47a
  1217. X#endif
  1218. X.
  1219. X46a
  1220. X#ifdef GENIX
  1221. X#define DIST    jhndist
  1222. X/*    genix compiler chokes on DIST macro below - jhn*/
  1223. X#else
  1224. X.
  1225. X6a
  1226. X#ifdef __TURBOC__
  1227. X/* work around the case-insensitivity of the DOS linker */
  1228. X#define Amonnam Amonnam_
  1229. X#define Xmonnam Xmonnam_
  1230. X#define Monnam Monnam_
  1231. X#define POISONOUS POISONOUS_
  1232. X#define Doname Doname_
  1233. X#define Tmp_at Tmp_at_
  1234. X/* rename the next two functions because they clash with the Turbo C library */
  1235. X#define getdate getdate_
  1236. X#define itoa itoa_
  1237. X#endif
  1238. X
  1239. X
  1240. X.
  1241. X1c
  1242. X/*    SCCS Id: @(#)hack.h    1.4    87/08/08
  1243. X.
  1244. Xw
  1245. Xq
  1246. XED_EOF
  1247. X
  1248. Xcp help help.orig
  1249. Xed help <<ED_EOF
  1250. X124c
  1251. X    v    prints the version number.
  1252. X    V    prints a longer identification of the version, including the
  1253. X        history of the game.
  1254. X    #    introduces one of the "extended" commands.  To get a list of
  1255. X        the commands you can use with "#" type "#?".  The extended
  1256. X        commands you can use depends upon what options the game was
  1257. X        compiled with, along with your class and what type of monster
  1258. X        you most closely resemble at a given moment.
  1259. X.
  1260. X91c
  1261. X    T    Takeoff armor.
  1262. X    A    Remove some or all armor.
  1263. X.
  1264. X88c
  1265. X    P    Put on a ring.
  1266. X.
  1267. X82a
  1268. X        If you see fancy graphics on your screen it may ask you to
  1269. X        specify a location rather than taking a symbol argument.
  1270. X.
  1271. Xw
  1272. Xq
  1273. XED_EOF
  1274. X
  1275. Xcp hh hh.orig
  1276. Xed hh <<ED_EOF
  1277. X49a
  1278. XT    remove    take off some armor
  1279. XA    remove    take off some or all armor
  1280. X.
  1281. X48d
  1282. X18c
  1283. Xv    version    print version number
  1284. XV    history    print game history.
  1285. X.
  1286. X4,7c
  1287. X /|\              (until stopped by e.g. a wall)
  1288. Xb j n        g<dir>:   fast movement in direction <dir>
  1289. X              (until something interesting is seen)
  1290. X        m<dir>:   move without picking up objects
  1291. X.
  1292. Xw
  1293. Xq
  1294. XED_EOF
  1295. X
  1296. Xcp invent.c invent.c.orig
  1297. Xed invent.c <<ED_EOF
  1298. X1024c
  1299. X    if (HI && HE)
  1300. X        Sprintf(buf, "%s%s%s", HI, names[pos - obj_symbols], HE);
  1301. X    else
  1302. X        Sprintf(buf, "%s", names[pos - obj_symbols]);
  1303. X.
  1304. X792,793c
  1305. X#ifdef KAA
  1306. X    read_engr_at(u.ux, u.uy); /* Eric Backus */
  1307. X.
  1308. X778,783d
  1309. X745c
  1310. X    if(c == GOLD_SYM)
  1311. X.
  1312. X717c
  1313. X    if(u.ugold) stuff[stct++] = GOLD_SYM;
  1314. X.
  1315. X507c
  1316. X        if(sym == GOLD_SYM) {
  1317. X.
  1318. X481c
  1319. X        if(allowgold) ilets[iletct++] = GOLD_SYM;
  1320. X.
  1321. X400c
  1322. X        if(ilet == GOLD_SYM) {
  1323. X.
  1324. X396a
  1325. X        }
  1326. X.
  1327. X395c
  1328. X        if(index(quitchars,ilet)) {
  1329. X            pline("Never mind.");
  1330. X.
  1331. X380c
  1332. X        }
  1333. X.
  1334. X374c
  1335. X        } else {
  1336. X.
  1337. X369c
  1338. X        if(!buf[0]) {
  1339. X.
  1340. X317c
  1341. X    if(allowgold) *bp++ = GOLD_SYM;
  1342. X.
  1343. X313c
  1344. X    if(*let == GOLD_SYM) let++, allowgold = TRUE;
  1345. X.
  1346. X282c
  1347. X    otmp->olet = GOLD_SYM;
  1348. X.
  1349. X1c
  1350. X/*    SCCS Id: @(#)invent.c    1.4    87/08/08
  1351. X.
  1352. Xw
  1353. Xq
  1354. XED_EOF
  1355. X
  1356. Xcp lev.c lev.c.orig
  1357. Xed lev.c <<ED_EOF
  1358. X374c
  1359. X                    nsym = showsyms.hwall;
  1360. X.
  1361. X372c
  1362. X                    nsym = showsyms.brcorn;
  1363. X.
  1364. X370c
  1365. X                    nsym = showsyms.blcorn;
  1366. X.
  1367. X368c
  1368. X                    nsym = showsyms.trcorn;
  1369. X.
  1370. X366c
  1371. X                    nsym = showsyms.tlcorn;
  1372. X.
  1373. X349c
  1374. X                        nsym = showsyms.hwall;
  1375. X.
  1376. X347c
  1377. X                        nsym = showsyms.vwall;
  1378. X.
  1379. X343c
  1380. X                        nsym = showsyms.vwall;
  1381. X.
  1382. X339c
  1383. X                        nsym = showsyms.corr;
  1384. X.
  1385. X335c
  1386. X                        nsym = showsyms.door;
  1387. X.
  1388. X331c
  1389. X                        nsym = showsyms.room;
  1390. X.
  1391. X320c
  1392. X    if (memcmp((char *) &osymbol, (char *) &showsyms, sizeof (struct symbols))) {
  1393. X.
  1394. X311c
  1395. X#ifdef GRAPHICS
  1396. X.
  1397. X289c
  1398. X#ifdef GRAPHICS
  1399. X.
  1400. X94,97c
  1401. X#ifdef DGK
  1402. X    if (!count_only)
  1403. X#endif
  1404. X    {
  1405. X        fgold = 0;
  1406. X        ftrap = 0;
  1407. X        fmon = 0;
  1408. X        fobj = 0;
  1409. X    }
  1410. X.
  1411. X75,76c
  1412. X#ifdef GRAPHICS
  1413. X    bwrite(fd, (char *) &showsyms, sizeof(struct symbols));
  1414. X.
  1415. X1c
  1416. X/*    SCCS Id: @(#)lev.c    1.4    87/08/08
  1417. X.
  1418. Xw
  1419. Xq
  1420. XED_EOF
  1421. X
  1422. Xcp makedefs.c makedefs.c.orig
  1423. Xed makedefs.c <<ED_EOF
  1424. X592a
  1425. X}
  1426. X#endif
  1427. X
  1428. X#ifdef __TURBOC__
  1429. Xint getpid() {
  1430. X    return(1);
  1431. X.
  1432. X583c
  1433. X#if defined(SYSV) || defined(GENIX)
  1434. X.
  1435. X255c
  1436. X    if(freopen(ONAME_FILE, WRMODE, stdout) == NULL) {
  1437. X.
  1438. X223d
  1439. X218a
  1440. X        printf("{\ta fountain\n");
  1441. X        } else
  1442. X#endif
  1443. X#ifdef NEWCLASS
  1444. X        if(!strcmp(inline, "^    a trap")) {
  1445. X        puts(inline);
  1446. X        printf("\\\tan opulant throne.\n");
  1447. X        } else
  1448. X#endif
  1449. X        puts(inline);
  1450. X.
  1451. X217a
  1452. X#ifdef    SPELLS
  1453. X        if (!strcmp(inline, "+    a door"))
  1454. X        printf("+\ta door (or a spell book)\n");
  1455. X        else
  1456. X#endif
  1457. X#ifdef    FOUNTAINS
  1458. X        if(!strcmp(inline, "}    water filled area")) {
  1459. X.
  1460. X215a
  1461. X        else if (!strcmp(inline, "\"    an amulet"))
  1462. X        printf("\"\tan amulet (or a web)\n");
  1463. X.
  1464. X210c
  1465. X        printf("r\ta rockmole\n");
  1466. X.
  1467. X191c
  1468. X    if(freopen(DATA_FILE, WRMODE, stdout) == NULL) {
  1469. X.
  1470. X186c
  1471. X    if(freopen(tmpfile, RDMODE, stdin) == NULL) {
  1472. X.
  1473. X176a
  1474. X#ifdef MSDOS
  1475. X    remove(DATE_FILE);
  1476. X#endif
  1477. X.
  1478. X159c
  1479. X    if(freopen(DATE_FILE, RDMODE, stdin) == NULL) {
  1480. X.
  1481. X154c
  1482. X    if(freopen(tmpfile, WRMODE, stdout) == NULL) {
  1483. X.
  1484. X139c
  1485. X    if(freopen(infile, RDMODE, stdin) == NULL)    perror(infile);
  1486. X.
  1487. X132c
  1488. X    if(freopen(infile, RDMODE, stdin) == NULL)    perror(infile);
  1489. X.
  1490. X122c
  1491. X#endif
  1492. X    if(freopen(infile, RDMODE, stdin) == NULL) {
  1493. X.
  1494. X120a
  1495. X#ifdef MSDOS
  1496. X    sprintf(infile, "%s.bas", RUMOR_FILE);
  1497. X#else
  1498. X.
  1499. X116c
  1500. X    if(freopen(RUMOR_FILE, WRMODE, stdout) == NULL) {
  1501. X.
  1502. X101a
  1503. X#ifdef MSDOS
  1504. X    remove(TRAP_FILE);
  1505. X#endif
  1506. X.
  1507. X68c
  1508. X    if(freopen(TRAP_FILE, RDMODE, stdin) == NULL) {
  1509. X.
  1510. X63c
  1511. X    if(freopen(tmpfile, WRMODE, stdout) == NULL) {
  1512. X.
  1513. X10a
  1514. X#define    alloc    malloc
  1515. X#define RDMODE    "r"
  1516. X#define WRMODE    "w"
  1517. X#else
  1518. X#define RDMODE    "r+"
  1519. X#define WRMODE    "w+"
  1520. X.
  1521. X4c
  1522. Xstatic    char    SCCS_Id[] = "@(#)makedefs.c    1.4\t87/08/08";
  1523. X.
  1524. Xw
  1525. Xq
  1526. XED_EOF
  1527. X
  1528. Xcp makemon.c makemon.c.orig
  1529. Xed makemon.c <<ED_EOF
  1530. X248c
  1531. X    cc->x = foo[rn2(tfoo-foo)].x;
  1532. X    cc->y = foo[rn2(tfoo-foo)].y;
  1533. X    return(0);
  1534. X.
  1535. X210,211c
  1536. Xenexto(cc, xx,yy)
  1537. Xcoord    *cc;
  1538. X.
  1539. X149c
  1540. X            enexto(&mm, mm.x, mm.y);
  1541. X.
  1542. X143d
  1543. X1c
  1544. X/*    SCCS Id: @(#)makemon.c    1.4    87/08/08
  1545. X.
  1546. Xw
  1547. Xq
  1548. XED_EOF
  1549. X
  1550. Xcp mklev.c mklev.c.orig
  1551. Xed mklev.c <<ED_EOF
  1552. X874c
  1553. X              mazexy(&mm);
  1554. X.
  1555. X872d
  1556. X847c
  1557. X            mazexy(&mm);
  1558. X.
  1559. X845d
  1560. X826,830c
  1561. X            fakegold ? '$' : fakedoor ? DOOR_SYM :
  1562. X.
  1563. X815c
  1564. X                mazexy(&mm);
  1565. X.
  1566. X813d
  1567. X731d
  1568. X727,729d
  1569. X717c
  1570. X        rm->scrsym = STONE_SYM;
  1571. X.
  1572. X709c
  1573. X        finddpos(&dd, aroom->lx, aroom->ly-1, aroom->hx, aroom->ly-1);
  1574. X.
  1575. X706c
  1576. X        finddpos(&dd, aroom->lx, aroom->hy+1, aroom->hx, aroom->hy+1);
  1577. X.
  1578. X575c
  1579. X            crm->scrsym = STONE_SYM;
  1580. X.
  1581. X570d
  1582. X566,568d
  1583. X539,540c
  1584. X        finddpos(&cc, croom->lx, yy, croom->hx, yy);
  1585. X        finddpos(&tt, troom->lx, ty, troom->hx, ty);
  1586. X.
  1587. X532,533c
  1588. X        finddpos(&cc, xx, croom->ly, xx, croom->hy);
  1589. X        finddpos(&tt, tx, troom->ly, tx, troom->hy);
  1590. X.
  1591. X526c
  1592. X        finddpos(&tt, troom->lx, ty, troom->hx, ty);
  1593. X.
  1594. X524c
  1595. X        finddpos(&cc, croom->lx, yy, croom->hx, yy);
  1596. X.
  1597. X518,519c
  1598. X        finddpos(&cc, xx, croom->ly, xx, croom->hy);
  1599. X        finddpos(&tt, tx, troom->ly, tx, troom->hy);
  1600. X.
  1601. X446,466c
  1602. X    levl[lowx-1][lowy-1].scrsym = TLCORN_SYM;
  1603. X    levl[hix+1][lowy-1].scrsym = TRCORN_SYM;
  1604. X    levl[lowx-1][hiy+1].scrsym = BLCORN_SYM;
  1605. X    levl[hix+1][hiy+1].scrsym = BRCORN_SYM;
  1606. X.
  1607. X443c
  1608. X        levl[x][y].scrsym = ROOM_SYM;
  1609. X.
  1610. X438c
  1611. X        levl[x][y].scrsym = VWALL_SYM;
  1612. X.
  1613. X433c
  1614. X        levl[x][y].scrsym = HWALL_SYM;
  1615. X.
  1616. X430d
  1617. X359,363c
  1618. X        levl[x][y].scrsym = DOOR_SYM;
  1619. X.
  1620. X355c
  1621. X    if(!IS_WALL(levl[x][y].typ))    /* avoid SDOORs with DOOR_SYM as scrsym */
  1622. X.
  1623. X315,317c
  1624. X    cc->x = x;
  1625. X    cc->y = y;
  1626. X    return(0);
  1627. X.
  1628. X294,296c
  1629. Xfinddpos(cc, xl,yl,xh,yh)
  1630. Xcoord    *cc;
  1631. Xint    xl,yl,xh,yh;
  1632. X{
  1633. X.
  1634. X79c
  1635. X    levl[xupstair][yupstair].scrsym = UP_SYM;
  1636. X.
  1637. X70c
  1638. X    levl[xdnstair][ydnstair].scrsym = DN_SYM;
  1639. X.
  1640. X28c
  1641. Xextern xchar xdnstair,xupstair,ydnstair,yupstair;
  1642. X.
  1643. X21c
  1644. Xextern coord doors[DOORMAX];
  1645. X.
  1646. X19c
  1647. Xextern struct mkroom rooms[MAXNROFROOMS+1];
  1648. X.
  1649. X1c
  1650. X/*    SCCS Id: @(#)mklev.c    1.4    87/08/08
  1651. X.
  1652. Xw
  1653. Xq
  1654. XED_EOF
  1655. X
  1656. Xcp mkmaze.c mkmaze.c.orig
  1657. Xed mkmaze.c <<ED_EOF
  1658. X182,187c
  1659. Xmazexy(cc)
  1660. Xcoord    *cc;
  1661. X{
  1662. X    cc->x = 3 + 2*rn2(COLNO/2 - 2);
  1663. X    cc->y = 3 + 2*rn2(ROWNO/2 - 2);
  1664. X    return(0);
  1665. X.
  1666. X93,94c
  1667. X    mazexy(&mm);
  1668. X    levl[(xupstair = mm.x)][(yupstair = mm.y)].scrsym = UP_SYM;
  1669. X.
  1670. X88c
  1671. X        mazexy(&mm);
  1672. X.
  1673. X84c
  1674. X        mazexy(&mm);
  1675. X.
  1676. X81c
  1677. X    mazexy(&mm);
  1678. X.
  1679. X78c
  1680. X        mazexy(&mm);
  1681. X.
  1682. X74c
  1683. X        mazexy(&mm);
  1684. X.
  1685. X63,70d
  1686. X61c
  1687. X                levl[x][y].scrsym = ROOM_SYM;
  1688. X.
  1689. X58c
  1690. X                levl[x][y].scrsym = HWALL_SYM;
  1691. X.
  1692. X56d
  1693. X45c
  1694. X        mazexy(&mm);
  1695. X.
  1696. X10d
  1697. X1c
  1698. X/*    SCCS Id: @(#)mkmaze.c    1.4    87/08/08
  1699. X.
  1700. Xw
  1701. Xq
  1702. XED_EOF
  1703. X
  1704. Xcp mkobj.c mkobj.c.orig
  1705. Xed mkobj.c <<ED_EOF
  1706. X134,135c
  1707. X                otmp->spe = -rne(3);
  1708. X            } else otmp->spe = rne(3);
  1709. X.
  1710. X121c
  1711. X            otmp->spe = -rne(2);
  1712. X.
  1713. X119c
  1714. X        if(!rn2(10)) otmp->spe = rne(2);
  1715. X.
  1716. X91c
  1717. X            otmp->spe = -rne(2);
  1718. X.
  1719. X88c
  1720. X        if(!rn2(11)) otmp->spe = rne(2);
  1721. X.
  1722. X1c
  1723. X/*    SCCS Id: @(#)mkobj.c    1.4    87/08/08
  1724. X.
  1725. Xw
  1726. Xq
  1727. XED_EOF
  1728. X
  1729. Xcp mon.c mon.c.orig
  1730. Xed mon.c <<ED_EOF
  1731. X710c
  1732. X        mtmp->mappearance = (levl[mtmp->mx][mtmp->my].typ == DOOR) ? DOOR_SYM : GOLD_SYM;
  1733. X.
  1734. X653c
  1735. X    enexto(&mm, u.ux, u.uy);
  1736. X.
  1737. X651d
  1738. X262c
  1739. X                tt = 1L << ttmp->ttyp;
  1740. X.
  1741. X260c
  1742. X          register long tt;
  1743. X.
  1744. X171c
  1745. X        if(levl[mtmp->mx][mtmp->my].scrsym == GOLD_SYM)
  1746. X.
  1747. X62a
  1748. X#endif
  1749. X.
  1750. X60a
  1751. X#ifdef HARD
  1752. X.
  1753. X1c
  1754. X/*    SCCS Id: @(#)mon.c    1.4    87/08/08
  1755. X.
  1756. Xw
  1757. Xq
  1758. XED_EOF
  1759. X
  1760. Xcp msdos.c msdos.c.orig
  1761. Xed msdos.c <<ED_EOF
  1762. X257c
  1763. X    char    *dta, buf[PATHLEN];
  1764. X.
  1765. X238a
  1766. X#endif
  1767. X.
  1768. X226c
  1769. X#ifndef __TURBOC__
  1770. X/* Get disk transfer area, Turbo C already has getdta */
  1771. X.
  1772. X1c
  1773. X/*    SCCS Id: @(#)msdos.c    1.4    87/08/08
  1774. X.
  1775. Xw
  1776. Xq
  1777. XED_EOF
  1778. X
  1779. Xcp msdos.h msdos.h.orig
  1780. Xed msdos.h <<ED_EOF
  1781. X31c
  1782. Xvoid    msmsg(char *, ...);
  1783. X.
  1784. X1c
  1785. X/*    SCCS Id: @(#)msdos.h    1.4    87/08/08
  1786. X.
  1787. Xw
  1788. Xq
  1789. XED_EOF
  1790. X
  1791. Xcp nethack.6 nethack.6.orig
  1792. Xed nethack.6 <<ED_EOF
  1793. X170a
  1794. X.PP
  1795. XDungeons & Dragons is a Trademark of TSR Inc.
  1796. X.
  1797. X110c
  1798. X.PP
  1799. X.
  1800. X107c
  1801. X.PP
  1802. X.
  1803. X103c
  1804. X.PP
  1805. X.
  1806. X100c
  1807. X.PP
  1808. X.
  1809. X97a
  1810. X.PP
  1811. X.
  1812. X36c
  1813. Xis a display oriented Dungeons & Dragons(tm) - like game.
  1814. X.
  1815. X20,21c
  1816. X.B /usr/games/net[hack quest]
  1817. X.
  1818. X6,7c
  1819. X.B /usr/games/net[hack quest]
  1820. X.
  1821. Xw
  1822. Xq
  1823. XED_EOF
  1824. X
  1825. Xcp o_init.c o_init.c.orig
  1826. Xed o_init.c <<ED_EOF
  1827. X21a
  1828. X
  1829. X    /* bug fix to prevent "initialization error" abort on Intel Xenix.
  1830. X     * reported by mikew@semike
  1831. X     */
  1832. X        for(i = 0; i != sizeof(obj_symbols); i++)
  1833. X                bases[i] = 0;
  1834. X
  1835. X.
  1836. X1c
  1837. X/*    SCCS Id: @(#)o_init.c    1.4    87/08/08
  1838. X.
  1839. Xw
  1840. Xq
  1841. XED_EOF
  1842. X
  1843. Xcp objclass.h objclass.h.orig
  1844. Xed objclass.h <<ED_EOF
  1845. X60a
  1846. X#define    GOLD_SYM    '$'
  1847. X.
  1848. X1c
  1849. X/*    SCCS Id: @(#)objclass.h    1.4    87/08/08
  1850. X.
  1851. Xw
  1852. Xq
  1853. XED_EOF
  1854. X
  1855. Xcp objects.h objects.h.orig
  1856. Xed objects.h <<ED_EOF
  1857. X185a
  1858. X# endif
  1859. X#else
  1860. X# ifdef KAA
  1861. X    { "enormous rock", NULL, NULL, 1, 0,
  1862. X        ROCK_SYM, 100, 0, 400 /* > MAX_CARR_CAP */, 0, 20, 20 },
  1863. X# else
  1864. X    { "enormous rock", NULL, NULL, 1, 0,
  1865. X        ROCK_SYM, 100, 0, 550 /* > MAX_CARR_CAP */, 0, 0, 0 },
  1866. X# endif
  1867. X.
  1868. X183c
  1869. X# else
  1870. X.
  1871. X180a
  1872. X#ifdef HARD
  1873. X# ifdef KAA
  1874. X.
  1875. X179d
  1876. X1c
  1877. X/*    SCCS Id: @(#)objects.h    1.4    87/08/08
  1878. X.
  1879. Xw
  1880. Xq
  1881. XED_EOF
  1882. X
  1883. Xcp options.c options.c.orig
  1884. Xed options.c <<ED_EOF
  1885. X393a
  1886. X
  1887. Xnmcpy(dest, source, maxlen)
  1888. X    char    *dest, *source;
  1889. X    int    maxlen;
  1890. X{
  1891. X    char    *cs, *cd;
  1892. X    int    count;
  1893. X
  1894. X    cd = dest;
  1895. X    cs = source;
  1896. X    for(count = 1; count < maxlen; count++) {
  1897. X        if(*cs == ',') break;
  1898. X        *cd++ = *cs++;
  1899. X    }
  1900. X    *cd = 0;
  1901. X}
  1902. X.
  1903. X304c
  1904. X"and engame.", "", "");
  1905. X.
  1906. X295a
  1907. X#ifdef    DOGNAME
  1908. X" dogname, which gives the name of your (first) dog (e.g. dogname:Rover)",
  1909. X#endif    /* DOGNAME */
  1910. X.
  1911. X294c
  1912. X            pline("%s%s%s%s",
  1913. X.
  1914. X278c
  1915. X#ifdef GRAPHICS
  1916. X"engame, and graphics.", "", "");
  1917. X#else
  1918. X"and engame.", "", "");
  1919. X#endif
  1920. X.
  1921. X269a
  1922. X#ifdef    DOGNAME
  1923. X" dogname, which gives the name of your (first) dog (e.g. dogname:Rover)",
  1924. X#endif    /* DOGNAME */
  1925. X.
  1926. X268c
  1927. X            pline("%s%s%s%s",
  1928. X.
  1929. X255a
  1930. X#ifdef    DOGNAME
  1931. X    if(!strncmp(opts, "dogname", 3)) {
  1932. X        extern char dogname[];
  1933. X        op = index(opts, ':');
  1934. X        if (!op) goto bad;
  1935. X        nmcpy(dogname, ++op, 62);
  1936. X        return;
  1937. X    }
  1938. X#endif    /* DOGNAME */
  1939. X.
  1940. X222a
  1941. X#ifdef GRAPHICS
  1942. X    /* graphics:string */
  1943. X    if(!strncmp(opts,"graphics",4)) {
  1944. X        char buf[MAXPCHARS];
  1945. X        if(!from_env) {
  1946. X#ifdef DGK
  1947. X          pline("'graphics' only settable from %s.", configfile);
  1948. X#else
  1949. X          pline("The graphics string can be set only from HACKOPTIONS.");
  1950. X#endif
  1951. X          return;
  1952. X        }
  1953. X        op = index(opts,':');
  1954. X        if(!op)
  1955. X            goto bad;
  1956. X        else
  1957. X            opts++;
  1958. X/*
  1959. X * You could have problems here if you configure FOUNTAINS, SPIDERS or NEWCLASS
  1960. X * in or out and forget to change the tail entries in your graphics string.
  1961. X */
  1962. X#define SETPCHAR(f, n)    showsyms.f = (strlen(opts) > n) ? opts[n] : defsyms.f
  1963. X        SETPCHAR(stone, 0);
  1964. X        SETPCHAR(vwall, 1);
  1965. X        SETPCHAR(hwall, 2);
  1966. X        SETPCHAR(tlcorn, 3);
  1967. X        SETPCHAR(trcorn, 4);
  1968. X        SETPCHAR(blcorn, 5);
  1969. X        SETPCHAR(brcorn, 6);
  1970. X        SETPCHAR(door, 7);
  1971. X        SETPCHAR(room, 8);
  1972. X        SETPCHAR(corr, 9);
  1973. X        SETPCHAR(upstair, 10);
  1974. X        SETPCHAR(dnstair, 11);
  1975. X        SETPCHAR(trap, 12);
  1976. X#ifdef FOUNTAINS
  1977. X        SETPCHAR(pool, 13);
  1978. X        SETPCHAR(fountain, 14);
  1979. X#endif
  1980. X#ifdef NEWCLASS
  1981. X        SETPCHAR(throne, 15);
  1982. X#endif
  1983. X#ifdef SPIDERS
  1984. X        SETPCHAR(web, 16);
  1985. X#endif
  1986. X#undef SETPCHAR
  1987. X        return;
  1988. X    }
  1989. X#endif /* GRAPHICS */
  1990. X
  1991. X.
  1992. X219c
  1993. X        nmcpy(plname, op+1, sizeof(plname)-1);
  1994. X.
  1995. X36c
  1996. X#endif
  1997. X#ifdef HACKOPTIONS
  1998. X.
  1999. X1c
  2000. X/*    SCCS Id: @(#)options.c    1.4    87/08/08
  2001. X.
  2002. Xw
  2003. Xq
  2004. XED_EOF
  2005. X
  2006. Xcp pager.c pager.c.orig
  2007. Xed pager.c <<ED_EOF
  2008. X422c
  2009. X    (void) wait((int *) 0);
  2010. X.
  2011. X385,403d
  2012. X43a
  2013. X#endif
  2014. X.
  2015. X42a
  2016. X#ifdef GRAPHICS
  2017. X                buf[0] = r;
  2018. X#else
  2019. X.
  2020. X29a
  2021. X#else
  2022. X        coord    cc; extern coord getpos();
  2023. X        char    r;    
  2024. X
  2025. X        pline("Please move the cursor to the unknown object.");
  2026. X        getpos(&cc, TRUE, "the unknown object");
  2027. X        r = levl[cc.x][cc.y].scrsym;
  2028. X
  2029. X        if (r == showsyms.stone) q = defsyms.stone;
  2030. X        else if (r == showsyms.vwall) q = defsyms.vwall;
  2031. X        else if (r == showsyms.hwall) q = defsyms.hwall;
  2032. X        else if (r == showsyms.tlcorn) q = defsyms.tlcorn;
  2033. X        else if (r == showsyms.trcorn) q = defsyms.trcorn;
  2034. X        else if (r == showsyms.blcorn) q = defsyms.blcorn;
  2035. X        else if (r == showsyms.brcorn) q = defsyms.brcorn;
  2036. X        else if (r == showsyms.door) q = defsyms.door;
  2037. X        else if (r == showsyms.room) q = defsyms.room;
  2038. X        else if (r == showsyms.corr) q = defsyms.corr;
  2039. X        else if (r == showsyms.upstair) q = defsyms.upstair;
  2040. X        else if (r == showsyms.dnstair) q = defsyms.dnstair;
  2041. X        else if (r == showsyms.trap) q = defsyms.trap;
  2042. X#ifdef FOUNTAINS
  2043. X        else if (r == showsyms.pool) q = defsyms.pool;
  2044. X        else if (r == showsyms.fountain) q = defsyms.fountain;
  2045. X#endif
  2046. X#ifdef NEWCLASS
  2047. X        else if (r == showsyms.throne) q = defsyms.throne;
  2048. X#endif
  2049. X#ifdef SPIDERS
  2050. X        else if (r == showsyms.web) q = defsyms.web;
  2051. X        else
  2052. X            q = r;
  2053. X#endif
  2054. X#endif /* GRAPHICS */
  2055. X.
  2056. X27a
  2057. X#ifndef GRAPHICS
  2058. X.
  2059. X1c
  2060. X/*    SCCS Id: @(#)pager.c    1.4    87/08/08
  2061. X.
  2062. Xw
  2063. Xq
  2064. XED_EOF
  2065. X
  2066. Xcp pcmain.c pcmain.c.orig
  2067. Xed pcmain.c <<ED_EOF
  2068. X363a
  2069. X            if (!rn2(4)) u_wipe_engr(rnd(3));
  2070. X.
  2071. X254c
  2072. X        read_engr_at(u.ux,u.uy);
  2073. X.
  2074. X54a
  2075. X
  2076. X#ifdef GRAPHICS
  2077. X    /* Set the default values of the presentation characters */
  2078. X    memcpy((char *) &showsyms, (char *) &defsyms, sizeof(struct symbols));
  2079. X#endif
  2080. X.
  2081. X1c
  2082. X/*    SCCS Id: @(#)pcmain.c    1.4    87/08/08
  2083. X.
  2084. Xw
  2085. Xq
  2086. XED_EOF
  2087. X
  2088. Xcp pctty.c pctty.c.orig
  2089. Xed pctty.c <<ED_EOF
  2090. X205a
  2091. X#ifdef COM_COMPL
  2092. X/* Read in an extended command - doing command line completion for
  2093. X * when enough character have been entered to make a unique command.
  2094. X * This is just a modified getlin().   -jsb
  2095. X */
  2096. Xget_ext_cmd(bufp)
  2097. Xregister char *bufp;
  2098. X{
  2099. X    register char *obufp = bufp;
  2100. X    register int c;
  2101. X    int com_index, index;
  2102. X
  2103. X    flags.toplin = 2;        /* nonempty, no --More-- required */
  2104. X
  2105. X    for(;;) {
  2106. X        (void) fflush(stdout);
  2107. X        if((c = readchar()) == EOF) {
  2108. X            *bufp = 0;
  2109. X            return;
  2110. X        }
  2111. X        if(c == '\033') {
  2112. X            *obufp = c;
  2113. X            obufp[1] = 0;
  2114. X            return;
  2115. X        }
  2116. X        if(c == erase_char || c == '\b') {
  2117. X            if(bufp != obufp) {
  2118. X                bufp--;
  2119. X                putstr("\b \b"); /* putsym converts \b */
  2120. X            } else    bell();
  2121. X        } else if(c == '\n') {
  2122. X            *bufp = 0;
  2123. X            return;
  2124. X        } else if(' ' <= c && c < '\177') {
  2125. X                /* avoid isprint() - some people don't have it
  2126. X                   ' ' is not always a printing char */
  2127. X            *bufp = c;
  2128. X            bufp[1] = 0;
  2129. X            index = 0;
  2130. X            com_index = -1;
  2131. X
  2132. X            while(extcmdlist[index].ef_txt != (char *) 0){
  2133. X                if(!strncmp(obufp, extcmdlist[index].ef_txt,
  2134. X                strlen(obufp)))
  2135. X                    if(com_index == -1) /* No matches yet*/
  2136. X                        com_index = index;
  2137. X                    else /* More than 1 match */
  2138. X                        com_index = -2;
  2139. X                index++;
  2140. X            }
  2141. X            if(com_index >= 0){
  2142. X                strcpy(obufp,
  2143. X                extcmdlist[com_index].ef_txt);
  2144. X                /* finish print our string */
  2145. X                putstr(bufp);
  2146. X                bufp = obufp; /* reset it */
  2147. X                if(strlen(obufp) < BUFSIZ-1 &&
  2148. X                 strlen(obufp) < COLNO)
  2149. X                    /* set bufp at the end of our
  2150. X                     * string
  2151. X                     */
  2152. X                    bufp += strlen(obufp);
  2153. X            } else {
  2154. X                putstr(bufp);
  2155. X                if(bufp-obufp < BUFSZ-1 && bufp-obufp < COLNO)
  2156. X                    bufp++;
  2157. X            }
  2158. X        } else if(c == kill_char || c == '\177') { /* Robert Viduya */
  2159. X                /* this test last - @ might be the kill_char */
  2160. X            while(bufp != obufp) {
  2161. X                bufp--;
  2162. X                putstr("\b \b");
  2163. X            }
  2164. X        } else
  2165. X            bell();
  2166. X    }
  2167. X
  2168. X}
  2169. X#endif COM_COMPL
  2170. X.
  2171. X8a
  2172. X#include "func_tab.h"
  2173. X.
  2174. X1c
  2175. X/*    SCCS Id: @(#)pctty.c    1.4    87/08/08
  2176. X.
  2177. Xw
  2178. Xq
  2179. XED_EOF
  2180. X
  2181. Xcp pcunix.c pcunix.c.orig
  2182. Xed pcunix.c <<ED_EOF
  2183. X80a
  2184. X}
  2185. X
  2186. Xgethdate(name) char *name; {
  2187. X/* old version - for people short of space */
  2188. X/*
  2189. X/* register char *np;
  2190. X/*      if(stat(name, &hbuf))
  2191. X/*              error("Cannot get status of %s.",
  2192. X/*                      (np = rindex(name, '/')) ? np+1 : name);
  2193. X/*
  2194. X/* version using PATH from: seismo!gregc@ucsf-cgl.ARPA (Greg Couch) */
  2195. X
  2196. X/*
  2197. X * The problem with   #include  <sys/param.h> is that this include file
  2198. X * does not exist on all systems, and moreover, that it sometimes includes
  2199. X * <sys/types.h> again, so that the compiler sees these typedefs twice.
  2200. X */
  2201. X#define         MAXPATHLEN      1024
  2202. X
  2203. Xregister char *np, *path;
  2204. Xchar filename[MAXPATHLEN+1];
  2205. X
  2206. X    if (index(name, '/') != NULL || (path = getenv("PATH")) == NULL)
  2207. X        path = "";
  2208. X
  2209. X    for (;;) {
  2210. X        if ((np = index(path, ':')) == NULL)
  2211. X            np = path + strlen(path);       /* point to end str */
  2212. X        if (np - path <= 1)                     /* %% */
  2213. X            (void) strcpy(filename, name);
  2214. X        else {
  2215. X            (void) strncpy(filename, path, np - path);
  2216. X            filename[np - path] = '/';
  2217. X            (void) strcpy(filename + (np - path) + 1, name);
  2218. X        }
  2219. X        if (stat(filename, &hbuf) == 0)
  2220. X            return;
  2221. X        if (*np == '\0')
  2222. X        path = "";
  2223. X        path = np + 1;
  2224. X    }
  2225. X    error("Cannot get status of %s.", (np = rindex(name, '/')) ? np+1 : name);
  2226. X}
  2227. X
  2228. Xuptodate(fd) {
  2229. X    if(fstat(fd, &buf)) {
  2230. X        pline("Cannot get status of saved level? ");
  2231. X        return(0);
  2232. X    }
  2233. X    if(buf.st_mtime < hbuf.st_mtime) {
  2234. X        pline("Saved level is out of date. ");
  2235. X        return(0);
  2236. X    }
  2237. X    return(1);
  2238. X.
  2239. X21a
  2240. Xstatic struct stat buf, hbuf;
  2241. X.
  2242. X19a
  2243. X#include        <sys/stat.h>
  2244. X.
  2245. X18a
  2246. X#endif
  2247. X.
  2248. X17a
  2249. X#ifndef __TURBOC__  /* Turbo C has time_t in time.h */
  2250. X.
  2251. X15a
  2252. X#include <stdio.h>    /* mainly for NULL */
  2253. X.
  2254. X1c
  2255. X/*    SCCS Id: @(#)pcunix.c    1.4    87/08/08
  2256. X.
  2257. Xw
  2258. Xq
  2259. XED_EOF
  2260. X
  2261. Xcp polyself.c polyself.c.orig
  2262. Xed polyself.c <<ED_EOF
  2263. X175a
  2264. X
  2265. X     if (u.uhp < 1)    done("died");
  2266. X.
  2267. X1c
  2268. X/*    SCCS Id: @(#)polyself.c    1.4    87/08/08
  2269. X.
  2270. Xw
  2271. Xq
  2272. XED_EOF
  2273. X
  2274. Xcp potion.c potion.c.orig
  2275. Xed potion.c <<ED_EOF
  2276. X588,595c
  2277. X    if(u.ustr > 118)    u.ustr = 118;
  2278. X    if(u.ustr > u.ustrmax)    u.ustrmax = u.ustr;
  2279. X.
  2280. X586c
  2281. X    if (inc) u.ustr++;
  2282. X    else {
  2283. X             if (u.ustr < 18) u.ustr += (rn2(4) ? 1 : rnd(6) );
  2284. X         else if (u.ustr < 103) u.ustr += rnd(10);
  2285. X         else u.ustr++;
  2286. X           }
  2287. X.
  2288. X562a
  2289. X#ifdef HARD
  2290. X    else    if (!rn2(4)) useup(potion);
  2291. X#endif
  2292. X.
  2293. X306c
  2294. X        if (u.mh > u.mhmax) u.mh = (u.mhmax + nxtra);
  2295. X.
  2296. X1c
  2297. X/*    SCCS Id: @(#)potion.c    1.4    87/08/08
  2298. X.
  2299. Xw
  2300. Xq
  2301. XED_EOF
  2302. X
  2303. Xcp pray.c pray.c.orig
  2304. Xed pray.c <<ED_EOF
  2305. X161a
  2306. X#ifdef NEWCLASS
  2307. Xdoturn() {    /* Knights & Priest(esse)s only please */
  2308. X
  2309. X    register struct monst *mtmp;
  2310. X    register int    xlev = 6;
  2311. X    extern char    pl_character[];
  2312. X
  2313. X    if((pl_character[0] != 'P') &&
  2314. X       (pl_character[0] != 'K')) {
  2315. X
  2316. X        pline("You don't know how to turn undead!");
  2317. X        return(0);
  2318. X    }
  2319. X    if (Inhell) {
  2320. X
  2321. X        pline("Being in hell, your gods won't help you.");
  2322. X        aggravate();
  2323. X        return(0);
  2324. X    }
  2325. X    pline("Calling upon your gods, you chant an arcane formula.");
  2326. X    for(mtmp = fmon; mtmp; mtmp = mtmp->nmon)
  2327. X        if(cansee(mtmp->mx,mtmp->my)) {
  2328. X        if(index(UNDEAD,mtmp->data->mlet) ||
  2329. X           ((mtmp->data->mlet == '&') && (u.ulevel > 10))) {
  2330. X
  2331. X            if(Confusion) {
  2332. X            pline("Unfortunately, your voice falters.");
  2333. X            mtmp->mflee = mtmp->mfroz = mtmp->msleep = 0;
  2334. X            } else if (! resist(mtmp, '+', 0, TELL))
  2335. X            switch (mtmp->data->mlet) {
  2336. X                case 'V':   xlev += 2;
  2337. X                case 'W':   xlev += 4;
  2338. X                case 'Z':   if(u.ulevel >= xlev)  {
  2339. X                        if(!resist(mtmp, '+', 0, NOTELL)) {
  2340. X                        pline("You destroy the %s", monnam(mtmp));
  2341. X                        mondied(mtmp);
  2342. X                        } else    mtmp->mflee = 1;
  2343. X                    } else    mtmp->mflee = 1;
  2344. X                    break;
  2345. X                default:    mtmp->mflee = 1;
  2346. X                    break;
  2347. X            }
  2348. X           }
  2349. X        }
  2350. X        nomul(-5);
  2351. X        return(1);
  2352. X}
  2353. X#endif /* NEWCLASS /**/
  2354. X.
  2355. X140c
  2356. X            mkobj_at('+', u.ux, u.uy);
  2357. X.
  2358. X131c
  2359. X                Protection |= INTRINSIC;
  2360. X.
  2361. X127c
  2362. X                Stealth |= INTRINSIC;
  2363. X.
  2364. X124c
  2365. X                Fast |= INTRINSIC;
  2366. X.
  2367. X121c
  2368. X                HTelepat |= INTRINSIC;
  2369. X.
  2370. X115a
  2371. X            flags.botl = 1;
  2372. X.
  2373. X91a
  2374. X#ifdef KAA
  2375. X.
  2376. X89c
  2377. X                if(uleft->cursed) {
  2378. X                pline("your left hand glows amber.");
  2379. X                uleft->cursed = 0;
  2380. X                } else if(uright->cursed) {
  2381. X                pline("your right hand glows amber.");
  2382. X                uleft->cursed = 0;
  2383. X                } else    pline("but nothing seems to happen.");
  2384. X.
  2385. X87d
  2386. X1c
  2387. X/*    SCCS Id: @(#)pray.c    1.4    87/08/08
  2388. X.
  2389. Xw
  2390. Xq
  2391. XED_EOF
  2392. X
  2393. Xcp pri.c pri.c.orig
  2394. Xed pri.c <<ED_EOF
  2395. X404c
  2396. X        u.mtimedone ? u.mh : u.uhp, u.mtimedone ? u.mhmax, u.uhpmax,
  2397. X.
  2398. X395c
  2399. X        u.mtimedone ? u.mh : u.uhp, u.mtimedone ? u.mhmax, u.uhpmax,
  2400. X.
  2401. X312d
  2402. X308,310d
  2403. X6a
  2404. X#ifdef GENIX
  2405. X#define    void    int    /* jhn - mod to prevent compiler from bombing */
  2406. X#endif
  2407. X.
  2408. X1c
  2409. X/*    SCCS Id: @(#)pri.c    1.4    87/08/08
  2410. X.
  2411. Xw
  2412. Xq
  2413. XED_EOF
  2414. X
  2415. Xcp prisym.c prisym.c.orig
  2416. Xed prisym.c <<ED_EOF
  2417. X248d
  2418. X245,246c
  2419. X        if(room->lit || cansee(x,y) || Blind) tmp = ROOM_SYM;
  2420. X        else tmp = STONE_SYM;
  2421. X.
  2422. X224,241d
  2423. X221c
  2424. X        tmp = DOOR_SYM;
  2425. X.
  2426. X217c
  2427. X        tmp = VWALL_SYM;
  2428. X.
  2429. X214c
  2430. X            tmp = HWALL_SYM;
  2431. X.
  2432. X210d
  2433. X203c
  2434. X    else if((ttmp = t_at(x,y)) && ttmp->tseen) tmp = TRAP_SYM;
  2435. X.
  2436. X201c
  2437. X    else if(ttmp && ttmp->tseen) tmp = TRAP_SYM;
  2438. X.
  2439. X196,198c
  2440. X        tmp = Hallucination ? rndobjsym() : GOLD_SYM;
  2441. X    else if(x == xupstair && y == yupstair) tmp = UP_SYM;
  2442. X    else if(x == xdnstair && y == ydnstair) tmp = DN_SYM;
  2443. X.
  2444. X191c
  2445. X    if(!room->seen) tmp = STONE_SYM;
  2446. X.
  2447. X172,173c
  2448. X        atl(x,y,Hallucination ? rndobjsym() : GOLD_SYM);
  2449. X    else if(!room->seen || room->scrsym == STONE_SYM) {
  2450. X.
  2451. X1c
  2452. X/*    SCCS Id: @(#)prisym.c    1.4    87/08/08
  2453. X.
  2454. Xw
  2455. Xq
  2456. XED_EOF
  2457. X
  2458. Xcp read.c read.c.orig
  2459. Xed read.c <<ED_EOF
  2460. X673c
  2461. X            if(lev->scrsym == STONE_SYM || !lev->scrsym)
  2462. X                newsym(zx,zy);
  2463. X.
  2464. X661,665c
  2465. X            lev->scrsym = DOOR_SYM;
  2466. X.
  2467. X658d
  2468. X654,656d
  2469. X633a
  2470. X        killer = "scroll of genocide";
  2471. X    /* A polymorphed character will die as soon as he is rehumanized. */
  2472. X        if(u.usym != '@')    pline("You feel dead inside.");
  2473. X        else            done("died");
  2474. X.
  2475. X631,632d
  2476. X602,604c
  2477. Xdo_genocide() {
  2478. X.
  2479. X345c
  2480. X                at(gtmp->gx, gtmp->gy, Hallucination ? rndobjsym() : GOLD_SYM);
  2481. X.
  2482. X324c
  2483. X                at(ttmp->tx, ttmp->ty, Hallucination ? rndobjsym() : GOLD_SYM);
  2484. X.
  2485. X166,168c
  2486. X# ifdef SPELLS
  2487. X            else if(sobj->otyp == SCR_SCARE_MONSTER)
  2488. X# endif
  2489. X            pline ("You hear %s close by.",
  2490. X                   (confused) ? "sad wailing" : "maniacal laughter");
  2491. X.
  2492. X164c
  2493. X              (confused) ? "sad wailing" : "maniacal laughter");
  2494. X.
  2495. X79c
  2496. X        {
  2497. X.
  2498. X69a
  2499. X    extern struct obj *some_armor();
  2500. X.
  2501. X1c
  2502. X/*    SCCS Id: @(#)read.c    1.4    87/08/08
  2503. X.
  2504. Xw
  2505. Xq
  2506. XED_EOF
  2507. X
  2508. Xcp rip.c rip.c.orig
  2509. Xed rip.c <<ED_EOF
  2510. X6a
  2511. X#ifdef GENIX
  2512. X#define    void    int    /* jhn - mod to prevent compiler from bombing */
  2513. X#endif
  2514. X.
  2515. X1c
  2516. X/*    SCCS Id: @(#)rip.c    1.4    87/08/08
  2517. X.
  2518. Xw
  2519. Xq
  2520. XED_EOF
  2521. X
  2522. Xcp rm.h rm.h.orig
  2523. Xed rm.h <<ED_EOF
  2524. X60,63c
  2525. X    unsigned typ:5;
  2526. X    unsigned new:1;
  2527. X    unsigned seen:1;
  2528. X    unsigned lit:1;
  2529. X.
  2530. X49a
  2531. X#define MAXPCHARS    17    /* maximum number of mapped characters */
  2532. X
  2533. X#define IS_CORNER(x)    ((x) == TLCORN_SYM || (x) == TRCORN_SYM \
  2534. X             || (x) == BLCORN_SYM || (x) == BRCORN_SYM)
  2535. X
  2536. X.
  2537. X47a
  2538. X/* screen symbols for using character graphics. */
  2539. Xstruct symbols {
  2540. X    unsigned char stone, vwall, hwall, tlcorn, trcorn, blcorn, brcorn;
  2541. X    unsigned char door, room, corr, upstair, dnstair, trap;
  2542. X#ifdef FOUNTAINS
  2543. X    unsigned char pool, fountain;
  2544. X#endif
  2545. X#ifdef NEWCLASS
  2546. X    unsigned char throne;
  2547. X#endif
  2548. X#ifdef SPIDERS
  2549. X    unsigned char web;
  2550. X#endif
  2551. X};
  2552. Xextern struct symbols showsyms, defsyms;
  2553. X
  2554. X#define STONE_SYM    showsyms.stone
  2555. X#define VWALL_SYM    showsyms.vwall
  2556. X#define HWALL_SYM    showsyms.hwall
  2557. X#define TLCORN_SYM    showsyms.tlcorn
  2558. X#define TRCORN_SYM    showsyms.trcorn
  2559. X#define BLCORN_SYM    showsyms.blcorn
  2560. X#define BRCORN_SYM    showsyms.brcorn
  2561. X#define DOOR_SYM    showsyms.door
  2562. X#define ROOM_SYM    showsyms.room
  2563. X#define    CORR_SYM    showsyms.corr
  2564. X#define UP_SYM        showsyms.upstair
  2565. X#define DN_SYM        showsyms.dnstair
  2566. X#define TRAP_SYM    showsyms.trap
  2567. X#define    POOL_SYM    showsyms.pool
  2568. X#define FOUNTAIN_SYM    showsyms.fountain
  2569. X#define THRONE_SYM      showsyms.throne
  2570. X#define WEB_SYM         showsyms.web
  2571. X#endif
  2572. X
  2573. X.
  2574. X46c
  2575. X#else /* GRAPHICS */
  2576. X.
  2577. X41a
  2578. X#define UP_SYM        '<'
  2579. X#define DN_SYM        '>'
  2580. X#define TRAP_SYM    '^'
  2581. X.
  2582. X40c
  2583. X# define    CORR_SYM    '#'
  2584. X.
  2585. X38c
  2586. X# define    CORR_SYM    ':'
  2587. X.
  2588. X36a
  2589. X#ifndef GRAPHICS
  2590. X
  2591. X#define STONE_SYM    ' '
  2592. X#define VWALL_SYM    '|'
  2593. X#define HWALL_SYM    '-'
  2594. X#define TLCORN_SYM    '+'
  2595. X#define TRCORN_SYM    '+'
  2596. X#define BLCORN_SYM    '+'
  2597. X#define BRCORN_SYM    '+'
  2598. X#define DOOR_SYM    '+'
  2599. X#define ROOM_SYM    '.'
  2600. X.
  2601. X35c
  2602. X * The level-map symbols may be compiled in or defined at initialization time
  2603. X.
  2604. X4a
  2605. X/*
  2606. X * The dungeon presentation graphics code and data structures were rewritten
  2607. X * and generalized for NetHack's release 2 by Eric S. Raymond (eric@snark)
  2608. X * building on Don G. Kneller's MS-DOS implementation. See options.c for
  2609. X * the code that permits the user to set the contents of the symbol structure.
  2610. X */
  2611. X
  2612. X.
  2613. X1c
  2614. X/*    SCCS Id: @(#)rm.h    1.4    87/08/08
  2615. X.
  2616. Xw
  2617. Xq
  2618. XED_EOF
  2619. X
  2620. Xcp rnd.c rnd.c.orig
  2621. Xed rnd.c <<ED_EOF
  2622. X30a
  2623. X}
  2624. X
  2625. Xrne(x)          /* by stewr 870807 */
  2626. Xregister x;
  2627. X{
  2628. X        register tmp = 1;
  2629. X    while(!rn2(x)) tmp++;
  2630. X    return(tmp);
  2631. X}
  2632. X
  2633. Xrnz(x)
  2634. Xregister x;
  2635. X{
  2636. X        register tmp = 1000;
  2637. X    tmp += rn2(1000);
  2638. X    tmp *= rne(4);
  2639. X    if (rn2(2)) { x *= tmp; x /= 1000; }
  2640. X    else { x *= 1000; x /= tmp; }
  2641. X    return(x);
  2642. X.
  2643. X1c
  2644. X/*    SCCS Id: @(#)rnd.c    1.4    87/08/08
  2645. X.
  2646. Xw
  2647. Xq
  2648. XED_EOF
  2649. X
  2650. Xcp save.c save.c.orig
  2651. Xed save.c <<ED_EOF
  2652. X379c
  2653. X            mtmp->data = &d_prince;
  2654. X.
  2655. X376c
  2656. X            mtmp->data = &d_lord;
  2657. X.
  2658. X49a
  2659. X#endif
  2660. X.
  2661. X48a
  2662. X#ifndef __TURBOC__
  2663. X.
  2664. X1c
  2665. X/*    SCCS Id: @(#)save.c    1.4    87/08/08
  2666. X.
  2667. Xw
  2668. Xq
  2669. XED_EOF
  2670. X
  2671. Xcp search.c search.c.orig
  2672. Xed search.c <<ED_EOF
  2673. X106c
  2674. X                if(!vism_at(x,y)) atl(x,y,TRAP_SYM);
  2675. X.
  2676. X103c
  2677. X                    return(1);
  2678. X.
  2679. X100,101c
  2680. X                    deltrap(trap);
  2681. X                    if((mtmp=makemon(PM_PIERCER,x,y)))
  2682. X.
  2683. X50c
  2684. X                        atl(zx,zy,TRAP_SYM);
  2685. X.
  2686. X40d
  2687. X36,38d
  2688. X28,32c
  2689. X                atl(zx, zy, DOOR_SYM);
  2690. X.
  2691. X1c
  2692. X/*    SCCS Id: @(#)search.c    1.4    87/08/08
  2693. X.
  2694. Xw
  2695. Xq
  2696. XED_EOF
  2697. X
  2698. Xcp shk.c shk.c.orig
  2699. Xed shk.c <<ED_EOF
  2700. X249,250c
  2701. X            box = carrying(ICE_BOX) != (struct obj *)0;
  2702. X            pick = carrying(PICK_AXE) != (struct obj *)0;
  2703. X.
  2704. X242a
  2705. X            struct obj *carrying();
  2706. X.
  2707. X1c
  2708. X/*    SCCS Id: @(#)shk.c    1.4    87/08/08
  2709. X.
  2710. Xw
  2711. Xq
  2712. XED_EOF
  2713. X
  2714. Xcp sit.c sit.c.orig
  2715. Xed sit.c <<ED_EOF
  2716. X137c
  2717. X/*            levl[u.ux][u.uy].scrsym = ROOM_SYM; */
  2718. X.
  2719. X53a
  2720. X                heal_legs();
  2721. X.
  2722. X1c
  2723. X/*    SCCS Id: @(#)sit.c    1.4    87/08/08
  2724. X.
  2725. Xw
  2726. Xq
  2727. XED_EOF
  2728. X
  2729. Xcp spell.c spell.c.orig
  2730. Xed spell.c <<ED_EOF
  2731. X256c
  2732. X        healup(rnd(8), 0, 0, 0);
  2733. X.
  2734. X231,232c
  2735. X        if (!(objects[pseudo->otyp].bits & NODIR)) {
  2736. X            getdir(1);
  2737. X            if(!u.dx && !u.dy && !u.dz && (u.ulevel > 8)) {
  2738. X                if((damage = zapyourself(pseudo)))
  2739. X                losehp(damage, "self-inflicted injury");
  2740. X            } else    weffects(pseudo);
  2741. X        } else weffects(pseudo);
  2742. X.
  2743. X206c
  2744. X        if (Hallucination)
  2745. X            pline("Far out... a light show!");
  2746. X        else    pline("The air around you crackles as you goof up.");
  2747. X.
  2748. X204c
  2749. X    if (confused ||
  2750. X        (rn2(10) + u.ulevel + u.uluck - spellev(spell)) <= 0) {
  2751. X.
  2752. X182c
  2753. X    register int     spell, energy, damage;
  2754. X.
  2755. X164,174c
  2756. X    default:
  2757. X        rndcurse();
  2758. X.
  2759. X123c
  2760. X    switch(rn2(level)) {
  2761. X.
  2762. X1,2c
  2763. X/*    SCCS Id: @(#)spell.c    1.4    87/08/08
  2764. X/* spell.c - version 1.0.1        M. Stephenson 07-04-86 */
  2765. X.
  2766. Xw
  2767. Xq
  2768. XED_EOF
  2769. X
  2770. Xcp steal.c steal.c.orig
  2771. Xed steal.c <<ED_EOF
  2772. X203c
  2773. X            atl(mtmp->mx,mtmp->my, Hallucination ? rndobjsym() : GOLD_SYM);
  2774. X.
  2775. X1c
  2776. X/*    SCCS Id: @(#)steal.c    1.4    87/08/08
  2777. X.
  2778. Xw
  2779. Xq
  2780. XED_EOF
  2781. X
  2782. Xcp termcap.c termcap.c.orig
  2783. Xed termcap.c <<ED_EOF
  2784. X301,302c
  2785. X#ifdef TERMINFO
  2786. X        tputs("$<50>", 1, xputs);
  2787. X#else
  2788. X        tputs("50", 1, xputs);
  2789. X#endif
  2790. X.
  2791. X106,107c
  2792. X    /* Get rid of padding numbers for HI and HE.  Hope they
  2793. X     * aren't really needed!!!  HI and HE are ouputted to the
  2794. X     * pager as a string - so how can you send it NULLS???
  2795. X     *  -jsb
  2796. X     */
  2797. X        HI = (char *) alloc(strlen(SO));
  2798. X        HE = (char *) alloc(strlen(SE));
  2799. X        i = 0;
  2800. X        while(isdigit(SO[i])) i++;
  2801. X        strcpy(HI, &SO[i]);
  2802. X        i = 0;
  2803. X        while(isdigit(SE[i])) i++;
  2804. X        strcpy(HE, &SE[i]);
  2805. X.
  2806. X57a
  2807. X    register int i;
  2808. X.
  2809. X14a
  2810. X#endif
  2811. X.
  2812. X13c
  2813. X# endif
  2814. X.
  2815. X11c
  2816. X#ifndef TERMINFO
  2817. X# ifndef lint
  2818. X.
  2819. X7a
  2820. X#ifdef GENIX
  2821. X#define    void    int    /* jhn - mod to prevent compiler from bombing */
  2822. X#endif
  2823. X
  2824. X.
  2825. X5a
  2826. X#include <ctype.h>    /* for isdigit() */
  2827. X.
  2828. X1c
  2829. X/*    SCCS Id: @(#)termcap.c    1.4    87/08/08
  2830. X.
  2831. Xw
  2832. Xq
  2833. XED_EOF
  2834. X
  2835. Xcp topl.c topl.c.orig
  2836. Xed topl.c <<ED_EOF
  2837. X6a
  2838. X#ifdef GENIX
  2839. X#define    void    int    /* jhn - mod to prevent compiler from bombing */
  2840. X#endif
  2841. X
  2842. X.
  2843. X1c
  2844. X/*    SCCS Id: @(#)topl.c    1.4    87/08/08
  2845. X.
  2846. Xw
  2847. Xq
  2848. XED_EOF
  2849. X
  2850. Xcp topten.c topten.c.orig
  2851. Xed topten.c <<ED_EOF
  2852. X49c
  2853. X#define HUP
  2854. X.
  2855. X6a
  2856. X#ifdef GENIX
  2857. X#define    void    int    /* jhn - mod to prevent compiler from bombing */
  2858. X#endif
  2859. X
  2860. X.
  2861. X1c
  2862. X/*    SCCS Id: @(#)topten.c    1.4    87/08/08
  2863. X.
  2864. Xw
  2865. Xq
  2866. XED_EOF
  2867. X
  2868. Xcp trap.c trap.c.orig
  2869. Xed trap.c <<ED_EOF
  2870. X647c
  2871. X        newlevel = rnz(dlevel + 3);    /* 5 - 24 */
  2872. X.
  2873. X645c
  2874. X        newlevel = rn2(5) ? rnz(dlevel + 3) : 30;
  2875. X.
  2876. X562c
  2877. X    read_engr_at(u.ux,u.uy);
  2878. X.
  2879. X523c
  2880. X            getpos(&cc, 1, "the desired position"); /* 1: force valid */
  2881. X.
  2882. X507d
  2883. X173c
  2884. X                if (uwep && uwep->otyp == TWO_HANDED_SWORD) goto two_hand;
  2885. X.
  2886. X1c
  2887. X/*    SCCS Id: @(#)trap.c    1.4    87/08/08
  2888. X.
  2889. Xw
  2890. Xq
  2891. XED_EOF
  2892. X
  2893. Xcp u_init.c u_init.c.orig
  2894. Xed u_init.c <<ED_EOF
  2895. X396a
  2896. X# ifdef KAA
  2897. X        uwep->dknown = 1;    /* bless his primary weapon */
  2898. X# endif
  2899. X.
  2900. X221c
  2901. X        if (pc == 'q' || pc == 'Q') {
  2902. X
  2903. X            clearlocks();
  2904. X            settty((char *) 0);
  2905. X            exit(0);
  2906. X        }
  2907. X.
  2908. X203c
  2909. X    if (index("qQ", exper)) {
  2910. X        clearlocks();
  2911. X        settty((char *) 0);
  2912. X        exit(0);
  2913. X    }
  2914. X.
  2915. X7a
  2916. X#ifdef GENIX
  2917. X#define    void    int
  2918. X#endif
  2919. X
  2920. X.
  2921. X1c
  2922. X/*    SCCS Id: @(#)u_init.c    1.4    87/08/08
  2923. X.
  2924. Xw
  2925. Xq
  2926. XED_EOF
  2927. X
  2928. Xcp unixmain.c unixmain.c.orig
  2929. Xed unixmain.c <<ED_EOF
  2930. X568a
  2931. X
  2932. X#ifdef GENIX
  2933. Xjhndist(x1,y1,x2,y2)
  2934. X{
  2935. X    int x,y;
  2936. X    x=x1-x2;
  2937. X    y=y1-y2;
  2938. X    return (x*x + y*y);
  2939. X}
  2940. X#endif
  2941. X.
  2942. X334a
  2943. X            if (!rn2(4)) u_wipe_engr(rnd(3));
  2944. X.
  2945. X237c
  2946. X        read_engr_at(u.ux,u.uy);
  2947. X.
  2948. X72c
  2949. X#ifdef GRAPHICS
  2950. X    /* Set the default values of the presentation characters */
  2951. X    memcpy((char *) &showsyms, (char *) &defsyms, sizeof(struct symbols));
  2952. X#endif
  2953. X#ifdef HACKOPTIONS
  2954. X.
  2955. X1c
  2956. X/*    SCCS Id: @(#)unixmain.c    1.4    87/08/08
  2957. X.
  2958. Xw
  2959. Xq
  2960. XED_EOF
  2961. X
  2962. Xcp unixtty.c unixtty.c.orig
  2963. Xed unixtty.c <<ED_EOF
  2964. X331a
  2965. X
  2966. X#ifdef COM_COMPL
  2967. X/* Read in an extended command - doing command line completion for
  2968. X * when enough character have been entered to make a unique command.
  2969. X * This is just a modified getlin().   -jsb
  2970. X */
  2971. Xget_ext_cmd(bufp)
  2972. Xregister char *bufp;
  2973. X{
  2974. X    register char *obufp = bufp;
  2975. X    register int c;
  2976. X    int com_index, index;
  2977. X
  2978. X    flags.toplin = 2;        /* nonempty, no --More-- required */
  2979. X
  2980. X    for(;;) {
  2981. X        (void) fflush(stdout);
  2982. X        if((c = readchar()) == EOF) {
  2983. X            *bufp = 0;
  2984. X            return;
  2985. X        }
  2986. X        if(c == '\033') {
  2987. X            *obufp = c;
  2988. X            obufp[1] = 0;
  2989. X            return;
  2990. X        }
  2991. X        if(c == erase_char || c == '\b') {
  2992. X            if(bufp != obufp) {
  2993. X                bufp--;
  2994. X                putstr("\b \b"); /* putsym converts \b */
  2995. X            } else    bell();
  2996. X        } else if(c == '\n') {
  2997. X            *bufp = 0;
  2998. X            return;
  2999. X        } else if(' ' <= c && c < '\177') {
  3000. X                /* avoid isprint() - some people don't have it
  3001. X                   ' ' is not always a printing char */
  3002. X            *bufp = c;
  3003. X            bufp[1] = 0;
  3004. X            index = 0;
  3005. X            com_index = -1;
  3006. X
  3007. X            while(extcmdlist[index].ef_txt != (char *) 0){
  3008. X                if(!strncmp(obufp, extcmdlist[index].ef_txt,
  3009. X                strlen(obufp)))
  3010. X                    if(com_index == -1) /* No matches yet*/
  3011. X                        com_index = index;
  3012. X                    else /* More than 1 match */
  3013. X                        com_index = -2;
  3014. X                index++;
  3015. X            }
  3016. X            if(com_index >= 0){
  3017. X                strcpy(obufp,
  3018. X                extcmdlist[com_index].ef_txt);
  3019. X                /* finish print our string */
  3020. X                putstr(bufp);
  3021. X                bufp = obufp; /* reset it */
  3022. X                if(strlen(obufp) < BUFSIZ-1 &&
  3023. X                 strlen(obufp) < COLNO)
  3024. X                    /* set bufp at the end of our
  3025. X                     * string
  3026. X                     */
  3027. X                    bufp += strlen(obufp);
  3028. X            } else {
  3029. X                putstr(bufp);
  3030. X                if(bufp-obufp < BUFSZ-1 && bufp-obufp < COLNO)
  3031. X                    bufp++;
  3032. X            }
  3033. X        } else if(c == kill_char || c == '\177') { /* Robert Viduya */
  3034. X                /* this test last - @ might be the kill_char */
  3035. X            while(bufp != obufp) {
  3036. X                bufp--;
  3037. X                putstr("\b \b");
  3038. X            }
  3039. X        } else
  3040. X            bell();
  3041. X    }
  3042. X
  3043. X}
  3044. X#endif COM_COMPL
  3045. X.
  3046. X9a
  3047. X#include    "func_tab.h"
  3048. X.
  3049. X1c
  3050. X/*    SCCS Id: @(#)unixtty.c    1.4    87/08/08
  3051. X.
  3052. Xw
  3053. Xq
  3054. XED_EOF
  3055. X
  3056. Xcp version.c version.c.orig
  3057. Xed version.c <<ED_EOF
  3058. X78a
  3059. X
  3060. X#endif
  3061. X.
  3062. X70,72c
  3063. X    pg_line("    Scott R. Turner    Tom Almy          John S. Bien");
  3064. X    pg_line("    Gil Neiger         Ralf Brown      Eric S. Raymond");
  3065. X    pg_line("    Eric Backus        Roland McGrath    Greg Laskin");
  3066. X.
  3067. X29a
  3068. X#ifdef DGKMOD
  3069. X
  3070. X.
  3071. X1c
  3072. X/*    SCCS Id: @(#)version.c    1.4    87/08/08
  3073. X.
  3074. Xw
  3075. Xq
  3076. XED_EOF
  3077. X
  3078. Xcp wield.c wield.c.orig
  3079. Xed wield.c <<ED_EOF
  3080. X129c
  3081. X    return(obj && obj == uwep && obj->cursed &&
  3082. X.
  3083. X43c
  3084. X    else if (!uarmg && wep->otyp == DEAD_COCKATRICE) {
  3085. X.
  3086. X34,41d
  3087. X29c
  3088. X    else if(wep == &zeroobj) {
  3089. X      if(uwep == 0){
  3090. X        pline("You are already empty handed.");
  3091. X      } else {
  3092. X        setuwep((struct obj *) 0);
  3093. X        res++;
  3094. X        pline("You are empty handed.");
  3095. X      }
  3096. X    } else if(uwep == wep)
  3097. X.
  3098. X1c
  3099. X/*    SCCS Id: @(#)wield.c    1.4    87/08/08
  3100. X.
  3101. Xw
  3102. Xq
  3103. XED_EOF
  3104. X
  3105. Xcp wizard.c wizard.c.orig
  3106. Xed wizard.c <<ED_EOF
  3107. X421,423c
  3108. X        if((mtmp = mkmon_at(nasties[rn2(nastynum)], u.ux, u.uy)))  {
  3109. X
  3110. X            mtmp->msleep = 0;
  3111. X            mtmp->mpeaceful = 0;
  3112. X        }
  3113. X.
  3114. X417c
  3115. X    nastynum = sizeof(nasties) - 1;
  3116. X.
  3117. X215c
  3118. X#endif /* KAA /**/
  3119. X.
  3120. X211c
  3121. X# endif /* KOPS /**/
  3122. X.
  3123. X71c
  3124. X    if(!carrying(AMULET_SYM)) {
  3125. X.
  3126. X1c
  3127. X/*    SCCS Id: @(#)wizard.c    1.4    87/08/08
  3128. X.
  3129. Xw
  3130. Xq
  3131. XED_EOF
  3132. X
  3133. Xcp write.c write.c.orig
  3134. Xed write.c <<ED_EOF
  3135. X22a
  3136. X# endif
  3137. X.
  3138. X20d
  3139. X1c
  3140. X/*    SCCS Id: @(#)write.c    1.4    87/08/08
  3141. X.
  3142. Xw
  3143. Xq
  3144. XED_EOF
  3145. X
  3146. Xcp you.h you.h.orig
  3147. Xed you.h <<ED_EOF
  3148. X44c
  3149. X#endif
  3150. X.
  3151. X1c
  3152. X/*    SCCS Id: @(#)you.h    1.4    87/08/08
  3153. X.
  3154. Xw
  3155. Xq
  3156. XED_EOF
  3157. X
  3158. Xcp zap.c zap.c.orig
  3159. Xed zap.c <<ED_EOF
  3160. X629c
  3161. X        (dx == dy) ? '\\' : (dx && dy) ? '/' : dx ? HWALL_SYM : VWALL_SYM;
  3162. X.
  3163. X347,348c
  3164. X        default: impossible("object %d used?",obj->otyp);
  3165. X    }
  3166. X.
  3167. X343,345c
  3168. X#ifdef SPELLS
  3169. X        case SPE_LIGHT:
  3170. X            pline("You've blinded yourself!");
  3171. X            Blind += rnd(100);
  3172. X            break;        
  3173. X        case SPE_DIG:
  3174. X        case SPE_TURN_UNDEAD:
  3175. X        case SPE_DETECT_UNSEEN:
  3176. X#endif
  3177. X        case WAN_DIGGING:
  3178. X        case WAN_UNDEAD_TURNING:
  3179. X        case WAN_NOTHING:
  3180. X.
  3181. X340d
  3182. X337c
  3183. X        case WAN_DEATH:
  3184. X#ifdef SPELLS
  3185. X        case SPE_FINGER_OF_DEATH:
  3186. X#endif
  3187. X            killer = "death ray";
  3188. X.
  3189. X334c
  3190. X        case WAN_TELEPORTATION:
  3191. X#ifdef SPELLS
  3192. X        case SPE_TELEPORT_AWAY:
  3193. X#endif
  3194. X.
  3195. X331c
  3196. X        case WAN_SLOW_MONSTER:
  3197. X#ifdef SPELLS
  3198. X        case SPE_SLOW_MONSTER:
  3199. X#endif
  3200. X.
  3201. X327a
  3202. X#ifdef SPELLS
  3203. X        case SPE_SLEEP:
  3204. X#endif
  3205. X.
  3206. X310c
  3207. X        case WAN_CANCELLATION:
  3208. X#ifdef SPELLS
  3209. X        case SPE_CANCELLATION:
  3210. X#endif
  3211. X.
  3212. X307a
  3213. X#ifdef SPELLS
  3214. X        case SPE_POLYMORPH:
  3215. X#endif
  3216. X.
  3217. X306c
  3218. X        case WAN_POLYMORPH:
  3219. X.
  3220. X304a
  3221. X#ifdef SPELLS
  3222. X        case SPE_MAGIC_MISSILE:
  3223. X#endif
  3224. X            damage = d(4,6);
  3225. X            pline("Idiot!  You've shot yourself!"); 
  3226. X.
  3227. X301,303c
  3228. X        case WAN_MAGIC_MISSILE:
  3229. X.
  3230. X299a
  3231. X#ifdef SPELLS
  3232. X        case SPE_CONE_OF_COLD:
  3233. X#endif
  3234. X            pline("You imitate a popsicle!");
  3235. X            if (!Cold_resistance) damage=d(12,6);
  3236. X.
  3237. X296,298c
  3238. X        case WAN_COLD:
  3239. X.
  3240. X292a
  3241. X#ifdef SPELLS
  3242. X        case SPE_FIREBALL:
  3243. X#endif
  3244. X            pline("You've set light to yourself!");
  3245. X            if (!Fire_resistance) damage=d(12,6);
  3246. X.
  3247. X289,291c
  3248. X        case WAN_FIRE:
  3249. X.
  3250. X287d
  3251. X284,285c
  3252. X    switch(obj->otyp) {
  3253. X        case WAN_STRIKING:
  3254. X#ifdef SPELLS
  3255. X        case SPE_FORCE_BOLT:
  3256. X#endif
  3257. X            pline("You magically bash yourself!");
  3258. X.
  3259. X132a
  3260. X            /* Amulets gets cheap   stewr 870807 */
  3261. X        if (obj->otyp == AMULET_OF_YENDOR) otmp2->spe = obj->spe;
  3262. X        /* Wands of wishing max 3 stewr 870808 */
  3263. X        if ((otmp2->otyp == WAN_WISHING) 
  3264. X            && (obj->spe > 3)) otmp2->spe = 3;
  3265. X.
  3266. X1c
  3267. X/*    SCCS Id: @(#)zap.c    1.4    87/08/08
  3268. X.
  3269. Xw
  3270. Xq
  3271. XED_EOF
  3272. END_OF_update.patches
  3273. if test 43078 -ne `wc -c <update.patches`; then
  3274.     echo shar: \"update.patches\" unpacked with wrong size!
  3275. fi
  3276. # end of overwriting check
  3277. fi
  3278. echo shar: End of shell archive.
  3279. exit 0
  3280.